ci(release): add workflow_dispatch trigger for manual releases#3
Merged
Conversation
The release workflow only triggered on a v* tag push, which is awkward in environments that cannot push tags. Add a workflow_dispatch trigger that: - resolves the version from the input (or the VERSION file when omitted), - creates and pushes the v<version> tag from CI (GITHUB_TOKEN-pushed tags do not re-trigger this workflow, so there is no double run), - threads the resolved version to the npm/PyPI publish jobs via a job output instead of GITHUB_REF_NAME, so both the tag-push and dispatch paths publish the same version. The existing tag-push path is unchanged. https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
There was a problem hiding this comment.
Pull request overview
This PR updates the release pipeline to support manually-triggered releases via workflow_dispatch, while keeping the existing tag-push release behavior intact. It also standardizes how downstream publish jobs (npm/PyPI) derive the release version so both paths publish consistent artifacts.
Changes:
- Add a
workflow_dispatchtrigger with an optionalversioninput. - Resolve the release version in the
goreleaserjob, emit it as a job output, and (on manual runs) create/push the correspondingv<version>tag. - Update npm/PyPI publish jobs to use the resolved version output instead of
GITHUB_REF_NAME.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+49
to
+54
| if [ -z "$VERSION" ]; then | ||
| echo "could not resolve a version to release" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "resolved release version: v$VERSION" |
Comment on lines
+28
to
+30
| # Needed so the workflow_dispatch path can push the release tag. | ||
| # Tags pushed with GITHUB_TOKEN do not re-trigger this workflow. | ||
| persist-credentials: true |
Add an auto-release workflow that watches the VERSION file on main and, when it changes to a version without an existing tag, dispatches the release workflow for that version. The release workflow then creates the tag and publishes to npm + PyPI, so all build/publish logic stays in one place and manual tag/dispatch releases are unaffected. Uses workflow_dispatch to start the release, which is the documented exception to GITHUB_TOKEN not re-triggering workflows, so no PAT is needed. https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a manual
workflow_dispatchtrigger torelease.ymlso a release can be launched from the Actions tab (or the API) without pushing av*tag locally. The existing tag-push path is unchanged.How it works
On
workflow_dispatch, thegoreleaserjob:versioninput, falling back to the repo'sVERSIONfile when omitted.v<version>tag from CI. Tags pushed withGITHUB_TOKENdo not re-trigger this workflow, so there's no double run.draft: false).The resolved version is exposed as a job output and consumed by the
publish-npm/publish-pypijobs (instead ofGITHUB_REF_NAME), so both the tag-push and dispatch paths publish the same version.Usage
After merge: Actions → release → Run workflow (optionally enter a version; defaults to
VERSION=0.1.4). This builds the binaries, publishes a GitHub release, and publishesbumblebee-scanto npm and PyPI (requires theNPM_TOKEN/PYPI_TOKENrepo secrets).Notes
persist-credentials: trueon the goreleaser checkout so CI can push the tag; the job already hascontents: write.https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
Generated by Claude Code