Skip to content

feat(release): one version everywhere via @semantic-release/git#186

Merged
andreybavt merged 2 commits into
mainfrom
ktx-daemon-health-version
May 20, 2026
Merged

feat(release): one version everywhere via @semantic-release/git#186
andreybavt merged 2 commits into
mainfrom
ktx-daemon-health-version

Conversation

@andreybavt

Copy link
Copy Markdown
Contributor

Summary

  • Adds @semantic-release/git to the release plugin chain so package.json, release-policy.json, and packages/cli/package.json are committed back to the release branch after publish, keeping the published npm version and in-repo version files in sync (fixes the stale 0.1.0-rc.1 on main and the ~/.ktx/runtime/0.0.0-private runtime path).
  • Extends scripts/update-public-release-version.mjs to also bump packages/cli/package.json (read at runtime by cli-runtime.ts and forwarded to the daemon as KTX_DAEMON_VERSION, so /health reports the correct version).
  • Splits the existing single exec plugin into prepare-only and publish-only execs around the new git plugin, guaranteeing the file mutations are committed before the npm publish runs.
  • Widens assertPublicNpmReleaseTag to accept branch-<sanitized> tags so branch-RC publishes work end-to-end through the policy writer.

Operational follow-up (not a code change)

main branch protection has restrictions.apps: [], so the default GITHUB_TOKEN cannot 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.mjs
  • node --test scripts/update-public-release-version.test.mjs
  • node --test scripts/semantic-release-config.test.mjs
  • node --test 'scripts/*.test.mjs' — 180/180 pass
  • End-to-end smoke: invoking update-public-release-version.mjs 0.4.0 latest against a fixture rewrites all three target files as expected
  • Next live release shows matching versions across pnpm 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 /health endpoint

…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.
@vercel

vercel Bot commented May 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ktx-docs-site Ready Ready Preview, Comment May 20, 2026 2:56pm

Request Review

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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@andreybavt andreybavt merged commit 2f70861 into main May 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants