From 4e346e8866cd0e68db3e08a5c7b8a0709f208e26 Mon Sep 17 00:00:00 2001 From: Sameeul B Samee Date: Thu, 19 Nov 2026 13:10:22 -0500 Subject: [PATCH] ci: use release-please instead of bumpversion Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/docker.yml | 4 --- .github/workflows/pypi.yml | 5 +--- .github/workflows/release-please.yml | 45 ++++++++++++++++++++++++++++ .release-please-manifest.json | 3 ++ README.md | 4 ++- pyproject.toml | 35 ---------------------- release-please-config.json | 24 +++++++++++++++ requirements/requirements-base.txt | 2 +- 8 files changed, 77 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b6b3cda..cddac81 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,10 +2,6 @@ name: Docker on: workflow_dispatch: - push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ - - v[0-9]+.[0-9]+.[0-9]+-dev[0-9]+ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 44e5aa0..b4f23d8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,10 +1,7 @@ name: PyPi on: - push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ - - v[0-9]+.[0-9]+.[0-9]+-dev[0-9]+ + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..213fba9 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,45 @@ +name: Release Please + +on: + push: + branches: + - master + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + # Tags/releases created with GITHUB_TOKEN do not trigger other workflows, + # so dispatch the publish workflows explicitly on the new tag. + trigger-publish: + needs: release-please + if: ${{ needs.release-please.outputs.release_created }} + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: Trigger PyPI and Docker publish + uses: actions/github-script@v7 + with: + script: | + for (const workflow_id of ['pypi.yml', 'docker.yml']) { + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id, + ref: '${{ needs.release-please.outputs.tag_name }}' + }) + } diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..78baf5b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.5.0" +} diff --git a/README.md b/README.md index 4f0810e..95020dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.5.0) +# **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.5.0) [![Documentation Status](https://readthedocs.org/projects/bfio/badge/?version=latest)](https://bfio.readthedocs.io/en/latest/?badge=latest) [![PyPI](https://img.shields.io/pypi/v/bfio)](https://pypi.org/project/bfio/) @@ -50,6 +50,7 @@ be installed using pip: ## Docker + ### polusai/bfio:2.5.0 Ubuntu based container with bfio and all dependencies (including Java). @@ -61,6 +62,7 @@ Same as above, except comes with ImageJ and PyImageJ. ### polusai/bfio:2.5.0-tensorflow Tensorflow container with bfio installed. + ## Documentation diff --git a/pyproject.toml b/pyproject.toml index 2b97948..4a019ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,41 +86,6 @@ namespaces = false ] -[tool.bumpversion] -current_version = "2.5.0" -commit = true -tag = true -commit_args = "--no-verify" -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+)(?P\\d+))?" -serialize = [ - "{major}.{minor}.{patch}-{release}{build}", - "{major}.{minor}.{patch}" -] - -[tool.bumpversion.parts.release] -optional_value = "_" -first_value = "dev" -values = [ - "dev", - "_" -] - -[[tool.bumpversion.files]] -filename = "src/bfio/VERSION" -search = "{current_version}" -replace = "{new_version}" - -[[tool.bumpversion.files]] -filename = "requirements/requirements-base.txt" -search = "bfio=={current_version}" -replace = "bfio=={new_version}" - -[[tool.bumpversion.files]] -filename = "README.md" -search = "{current_version}" -replace = "{new_version}" - - [tool.codespell] skip = "*.svg,*.html" ignore-words-list = "utput" \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..12c0928 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,24 @@ +{ + "packages": { + ".": { + "release-type": "simple", + "package-name": "bfio", + "include-component-in-tag": false, + "version-file": "src/bfio/VERSION", + "changelog-sections": [ + {"type": "feat", "section": "Features"}, + {"type": "fix", "section": "Bug Fixes"}, + {"type": "perf", "section": "Performance Improvements"}, + {"type": "revert", "section": "Reverts"}, + {"type": "docs", "section": "Documentation"}, + {"type": "refactor", "section": "Code Refactoring"}, + {"type": "build", "section": "Build System"}, + {"type": "chore", "section": "Miscellaneous Chores", "hidden": true}, + {"type": "style", "section": "Styles", "hidden": true}, + {"type": "test", "section": "Tests", "hidden": true}, + {"type": "ci", "section": "Continuous Integration", "hidden": true} + ], + "extra-files": ["README.md", "requirements/requirements-base.txt"] + } + } +} diff --git a/requirements/requirements-base.txt b/requirements/requirements-base.txt index 1ce2768..6e11128 100644 --- a/requirements/requirements-base.txt +++ b/requirements/requirements-base.txt @@ -1 +1 @@ -bfio==2.5.0 +bfio==2.5.0 # x-release-please-version