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", {