diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47114ceb..87ffe656 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,9 +104,9 @@ jobs: set -euo pipefail # The `./` prefix is load-bearing: npm reads a slash-bearing arg without it # (`artifact/relavium-X.tgz`) as a GitHub `owner/repo` shorthand and tries to git-clone it. - # `./artifact/…` forces the local-file spec. (Verified via npm-package-arg.) - TGZ="./$(ls artifact/*.tgz)" - npm install -g "$TGZ" + # `./artifact/…` forces the local-file spec (verified via npm-package-arg); the glob expands to + # the single packed tarball, so no `ls`/subshell is needed. + npm install -g ./artifact/*.tgz echo "## relavium --help" && relavium --help >/dev/null echo "## relavium --version matches the published package version" VER="$(relavium --version)" @@ -135,6 +135,14 @@ jobs: contents: read id-token: write # npm provenance attestation steps: + # Checkout ONLY `.nvmrc` (sparse, non-cone) so `setup-node` can read the single Node-version source the + # pack/smoke jobs use too; publish needs no other repo files — it pushes the downloaded tarball, not a + # fresh build. (fetch-depth defaults to 1, so it is not set again.) + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + sparse-checkout: .nvmrc + sparse-checkout-cone-mode: false - name: Set up Node (npm registry) uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: @@ -149,6 +157,9 @@ jobs: # resolved in the packed manifest, so `npm publish ` is correct here (pnpm-pack did the resolving). - name: Publish shell: bash - run: npm publish "$(ls artifact/*.tgz)" --provenance --access public + # `./` for the same reason as the smoke install: a bare `artifact/…tgz` is read by npm as a GitHub + # `owner/repo` shorthand, not the local tarball. The `./artifact/*.tgz` glob forces the file spec and + # expands to the single downloaded tarball — no `ls`/subshell needed. + run: npm publish ./artifact/*.tgz --provenance --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}