Skip to content

Conversation

@harryswift01
Copy link
Contributor

Summary

This PR introduces a fully automated release workflow using GitHub Actions. The workflow provides version validation, automated pull-request creation, tagging, GitHub Releases, and PyPI publication, streamlining and securing the entire release process.

In addition, the workflow is compatible with Zenodo’s “flip-the-switch” integration, meaning that once Zenodo archiving is enabled, every GitHub Release generated by this workflow will automatically trigger a Zenodo deposition.

Changes

Add .github/workflows/release.yaml

This new workflow implements a multi-stage automated release pipeline:

Version Checks

  • Validates user-provided version input through workflow_dispatch.
  • Compares the requested version against the latest version on PyPI using semver, preventing accidental downgrades or duplicate versions.

Version Preparation

  • Updates the package version inside __init__.py.
  • Updates CITATION.cff version and date-released field (if present).
  • Automatically creates a pull request containing the version bump.
  • Auto-approves and merges the generated PR using automation.

Tag Creation

  • Generates and pushes a Git tag corresponding to the new version.

GitHub Release

  • Creates a GitHub Release using the newly created tag.
  • Automatically generates release notes.

PyPI Publication

  • Builds and publishes the package to PyPI using flit.
  • Uses the PYPI_API_TOKEN secret for authentication.

Zenodo Compatibility

  • Zenodo’s GitHub integration (“flip the switch”) can be enabled at any time.
  • Once enabled, each GitHub Release produced by this workflow will automatically be archived by Zenodo, creating a citable DOI for every release version.
  • No further changes to this workflow are required to support Zenodo.

Impact

  • Fully automates version bumping, tagging, and publishing workflows.
  • Reduces human error in version handling and release preparation.
  • Ensures consistent, traceable, and reproducible releases.
  • Minimises maintenance burden by integrating all steps into CI/CD.
  • Creates automatic GitHub Releases that can also produce Zenodo DOIs when the integration is enabled.
  • Provides a seamless path from version request → PR → tag → GitHub Release → PyPI publish → (optional) Zenodo archive.

@harryswift01 harryswift01 self-assigned this Dec 11, 2025
@harryswift01 harryswift01 linked an issue Dec 11, 2025 that may be closed by this pull request
3 tasks
@harryswift01 harryswift01 changed the title Update release workflow to use CCPBioSim-Python-Template Implement release workflow to use CCPBioSim-Python-Template Dec 11, 2025
@harryswift01 harryswift01 merged commit b78fe06 into main Dec 11, 2025
12 checks passed
@harryswift01 harryswift01 deleted the 26-automated-release-workflow branch December 11, 2025 11:43
@harryswift01 harryswift01 linked an issue Dec 11, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated changelog generation Automated release workflow:

2 participants