DX-2103: auto-derive release version (semver bump)#33
Merged
Conversation
Make the typed `version` input optional and add a `bump` input (patch/minor/major, default patch). When version is blank, resolve the next version from the latest vX.Y.Z tag and bump it; an explicit version still works as an override. Resolution happens once in validate_dispatch and is plumbed downstream as a job output. The tag re-dispatch already carries an explicit version, so the publish jobs are unchanged. Adds bumpVersion + resolveVersion with tests.
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.
What
Structural follow-up item 6 from DX-2103: stop requiring a hand-typed release version.
versioninput is now optional; blank = auto-bump the latestvX.Y.Ztag.bumpinput (patch/minor/major, defaultpatch) picks the level.versionstill works as an override.How it works
Resolution happens once in the
validate_dispatchjob (resolve-version) and is plumbed downstream as a job output. The tag re-dispatch already carries an explicitversion=<tag>, so the publish jobs (github_release,npm_publish,github_packages_publish) are unchanged and keep usinginputs.version.Changes
release-version.js— add purebumpVersion(base, level).release-workflow.js— addlatestTag()+resolveVersion()and aresolve-versioncommand; export both.release.yml— optionalversion+ newbumpinput;validate_dispatchresolves and exposesoutputs.version;tag_and_dispatchand thedry-runjob consume that output.release-workflow.test.js— tests forbumpVersion(levels, v-prefix, bad inputs) and theresolveVersionoverride path.Validation
node .github/scripts/release-workflow.test.jspasses.v0.0.11): patch→0.0.12, minor→0.1.0, major→1.0.0,VERSION_INPUT=v2.5.0→2.5.0.Safety
The explicit
versionoverride remains throughout, so this can't strand a release. Tag-exists / registry-version guards are unchanged (they run after resolution).