From d21acd9f2844faed4b1dda996c316b95ad350429 Mon Sep 17 00:00:00 2001 From: pdiakumis Date: Wed, 25 Mar 2026 22:40:38 +1100 Subject: [PATCH] add GHA-based version bumping workflow --- .github/workflows/bump.yaml | 19 +++++++++++++++++++ CLAUDE.md | 12 +++++++++++- Makefile | 10 +++++----- 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/bump.yaml diff --git a/.github/workflows/bump.yaml b/.github/workflows/bump.yaml new file mode 100644 index 0000000..efc1183 --- /dev/null +++ b/.github/workflows/bump.yaml @@ -0,0 +1,19 @@ +name: Bump Version + +on: + workflow_dispatch: + inputs: + version: + description: 'New version (e.g. 0.1.0)' + required: true + type: string + +jobs: + bump: + uses: tidywf/.github/.github/workflows/bump.yaml@main + permissions: + contents: write + with: + pkg_name: nemo + pkg_version: ${{ inputs.version }} + secrets: inherit diff --git a/CLAUDE.md b/CLAUDE.md index 488b38c..76c179d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -127,7 +127,17 @@ R code is formatted with [air](https://github.com/posit-dev/air) (100-char line ## Version Bumping and Release Workflow -Use `make bump VERSION=x.y.z` to bump the version. This runs `bump-my-version` (configured in `.bumpversion.toml`), which updates all version references across the repo in a single commit with the message `Bump version: OLD => NEW`. The CI workflow (`deploy.yaml`) triggers on that commit message pattern to build and publish the conda package and docs. +Bumping is done via the `.github/workflows/bump.yaml` GitHub Actions workflow, which installs the package, bumps all version references, renders `README.qmd`, and pushes a single `Bump version: OLD => NEW` commit directly to the branch (using the bot token to bypass branch protection). The `deploy.yaml` workflow triggers on that commit message pattern. + +Trigger it from the CLI: + +```bash +make bump VERSION=x.y.z BRANCH=dev +# or on main: +make bump VERSION=x.y.z BRANCH=main +``` + +This calls `gh workflow run bump.yaml --ref BRANCH --field version=VERSION` under the hood. Can also be triggered via the GitHub Actions UI: Actions → Bump Version → Run workflow. ## CI/CD: `.github/workflows/deploy.yaml` diff --git a/Makefile b/Makefile index a4b0261..0c92dd8 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,9 @@ build-readme: build readme bump: ifndef VERSION - $(error VERSION is not set. Usage: make bump VERSION=x.y.z) + $(error VERSION is not set. Usage: make bump VERSION=x.y.z BRANCH=dev) endif - @bump-my-version bump --new-version $(VERSION) - @$(MAKE) --no-print-directory build-readme - @git add README.md - @git commit --amend --no-edit +ifndef BRANCH + $(error BRANCH is not set. Usage: make bump VERSION=x.y.z BRANCH=dev) +endif + @gh workflow run bump.yaml --ref $(BRANCH) --field version=$(VERSION)