diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c945666..36428ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -216,8 +216,13 @@ jobs: publish-npm: name: Publish npm package needs: release - runs-on: blacksmith-4vcpu-ubuntu-2404 + # npm trusted publishing (OIDC) accepts GitHub-hosted runners only, so this + # job does not use the Blacksmith runners the build jobs use. + runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') + permissions: + contents: read + id-token: write # lets npm verify this workflow instead of a stored token steps: - name: Checkout uses: actions/checkout@v4 @@ -225,22 +230,30 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 20 - registry-url: "https://registry.npmjs.org" + node-version: 24 + + # Trusted publishing needs npm 11.5.1 or newer. + - name: Update npm + run: | + npm install -g npm@11 + npm --version # The npm package is a thin bootstrapper that downloads the binaries # published by the release job above, so it must publish AFTER the # GitHub Release exists. Stamps the package with the tag's version so - # `npm i -g @autter/cli@X.Y.Z` maps 1:1 onto release vX.Y.Z. Skips (rather - # than fails) when the NPM_TOKEN secret is not configured, so a release - # never blocks on npm. + # `npm i -g @autter/cli@X.Y.Z` maps 1:1 onto release vX.Y.Z. + # + # Authenticates with npm trusted publishing: npmjs.com trusts this + # workflow (Autter-dev/autter-cli, release.yml), so there is no NPM_TOKEN + # secret to expire. If this workflow file is renamed, the trusted + # publisher on npmjs.com must be recreated to match. A re-run skips the + # publish when this version is already on npm. - name: Publish to npm working-directory: npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - if [ -z "${NODE_AUTH_TOKEN}" ]; then - echo "NPM_TOKEN secret not set; skipping npm publish." + version="${GITHUB_REF_NAME#v}" + if [ "$(npm view "@autter/cli@${version}" version 2>/dev/null)" = "${version}" ]; then + echo "@autter/cli@${version} is already on npm; skipping." exit 0 fi npm version "${GITHUB_REF_NAME#v}" --no-git-tag-version --allow-same-version diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e6ec6c..3298e9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ This changelog is automatically generated by AI when releases are published. ## [Unreleased] +## [3.10.1] - 2026-11-15 + +### Fixed + +- **`npm i -g @autter/cli` installs the current release again.** 3.10.0's GitHub release went out but its npm publish was rejected, so npm stayed on 3.9.3. The release workflow now publishes to npm with trusted publishing instead of a stored token, so the npm package can no longer fall behind because a token expired. The CLI itself is unchanged from 3.10.0. + ## [3.10.0] - 2026-11-15 ### Added diff --git a/Cargo.lock b/Cargo.lock index be7e1d8..a48be24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,7 +258,7 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "autter" -version = "3.10.0" +version = "3.10.1" dependencies = [ "autter", "base64", diff --git a/Cargo.toml b/Cargo.toml index a22c41e..42a3154 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "3" [package] name = "autter" -version = "3.10.0" +version = "3.10.1" edition = "2024" default-run = "autter"