From bb8a1e256f78261c6f77f0396e2d742aaa2ca9d4 Mon Sep 17 00:00:00 2001 From: Felix Kotschenreuther Date: Sat, 11 Jul 2026 10:23:59 +0200 Subject: [PATCH] fix(release): stamp real version into ct-cli.tgz release asset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build job packed release/ct-cli.tgz via `npm pack` before semantic-release bumps the version, so the attached tarball always carried the placeholder 0.1.0 while GitHub Packages published the real computed version — the two npm-install paths diverged (surfaced by #83). Move the pack into the release job via @semantic-release/exec, which runs after @semantic-release/npm writes the bumped version into package.json, then rename the output back to the fixed ct-cli.tgz filename the stable releases/latest/download/ct-cli.tgz URL depends on (README + INSTALL.md). The pre-bump pack step in the build job is removed so exactly one, correctly-versioned tarball is produced. Closes #84 --- .github/workflows/release.yml | 10 +++++----- .releaserc.json | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 602ce5d..ff248db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,11 +55,10 @@ jobs: bun build --compile --target=bun-linux-x64 ./src/index.ts --outfile release/ct-linux-x64 chmod +x release/ct-darwin-arm64 release/ct-darwin-x64 release/ct-linux-x64 - - name: Package npm-pack tarball - run: | - npm pack --pack-destination release - mv release/*.tgz release/ct-cli.tgz - + # The release tarball is packed in the `release` job (via @semantic-release/exec) + # AFTER semantic-release bumps the version — packing it here would embed the + # placeholder 0.1.0 (see #84). The binaries + INSTALL.md below are version-agnostic + # assets the smoke jobs and release attach. - name: Write install note run: | cat > release/INSTALL.md <<'EOF' @@ -177,5 +176,6 @@ jobs: -p @semantic-release/commit-analyzer@13 \ -p @semantic-release/release-notes-generator@14 \ -p @semantic-release/npm@12 \ + -p @semantic-release/exec@6 \ -p @semantic-release/github@11 \ semantic-release diff --git a/.releaserc.json b/.releaserc.json index 0583a93..c7c337f 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -4,6 +4,13 @@ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/npm", + [ + "@semantic-release/exec", + { + "//": "Runs AFTER @semantic-release/npm has written the bumped version into package.json, so this tarball carries the real release version (not the placeholder 0.1.0 the build job packs pre-bump). Renamed to the fixed filename the stable releases/latest/download/ct-cli.tgz URL depends on (README + INSTALL.md). See #84.", + "prepareCmd": "npm pack --pack-destination release && mv release/eqrm-ct-cli-${nextRelease.version}.tgz release/ct-cli.tgz" + } + ], [ "@semantic-release/github", {