feat(release): one version everywhere via @semantic-release/git#186
Merged
Conversation
…erywhere Add @semantic-release/git to the release plugin chain so the bumped package.json, release-policy.json, and packages/cli/package.json land back on the release branch after publish. This keeps the published npm version and the in-repo version files in sync, so local builds from main report the released version (e.g. ktx --version and the daemon /health endpoint via KTX_DAEMON_VERSION). Also widens assertPublicNpmReleaseTag to accept branch-<sanitized> tags, unblocking branch RC publishes that pass through update-public-release- version.mjs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The bare releaseTag('rc') call defaulted to process.env.GITHUB_REF_NAME,
which on PR CI is the merge ref (e.g. 186/merge) and yields
'branch-186-merge' instead of 'next'. Pass an explicit { GITHUB_REF_NAME:
'main' } so the test exercises the main-rc path regardless of CI env.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
@semantic-release/gitto the release plugin chain sopackage.json,release-policy.json, andpackages/cli/package.jsonare committed back to the release branch after publish, keeping the published npm version and in-repo version files in sync (fixes the stale0.1.0-rc.1onmainand the~/.ktx/runtime/0.0.0-privateruntime path).scripts/update-public-release-version.mjsto also bumppackages/cli/package.json(read at runtime bycli-runtime.tsand forwarded to the daemon asKTX_DAEMON_VERSION, so/healthreports the correct version).assertPublicNpmReleaseTagto acceptbranch-<sanitized>tags so branch-RC publishes work end-to-end through the policy writer.Operational follow-up (not a code change)
mainbranch protection hasrestrictions.apps: [], so the defaultGITHUB_TOKENcannot push the release commit. Add the GitHub Actions app to the allowlist once:gh api -X POST repos/Kaelio/ktx/branches/main/protection/restrictions/apps --input <(echo '["github-actions"]')Test plan
node --test scripts/public-npm-release-metadata.test.mjsnode --test scripts/update-public-release-version.test.mjsnode --test scripts/semantic-release-config.test.mjsnode --test 'scripts/*.test.mjs'— 180/180 passupdate-public-release-version.mjs 0.4.0 latestagainst a fixture rewrites all three target files as expectedpnpm view @kaelio/ktx version,origin/main:package.json:version,origin/main:release-policy.json:publicNpmPackageVersion,origin/main:packages/cli/package.json:version, and the local daemon/healthendpoint