Skip to content

Commit 9ede7db

Browse files
committed
👷 github: setup npm trusted publishing
1 parent e35d9fa commit 9ede7db

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎.github/workflows/version.yaml‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches: [main]
55
concurrency: ${{ github.workflow }}-${{ github.ref }}
6+
permissions:
7+
id-token: write
68
jobs:
79
version:
810
environment: version
@@ -19,18 +21,31 @@ jobs:
1921
with:
2022
node-version: ">=22.16.0"
2123
cache: pnpm
24+
registry-url: https://registry.npmjs.org
25+
always-auth: true
26+
scope: "@exactly"
2227
- uses: foundry-rs/foundry-toolchain@v1
2328
- run: pnpm install --frozen-lockfile
2429
- uses: crazy-max/ghaction-import-gpg@v5 # cspell:ignore ghaction
2530
with:
2631
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
2732
git_user_signingkey: true # cspell:ignore signingkey
2833
git_commit_gpgsign: true # cspell:ignore gpgsign
34+
- name: npm debug
35+
run: |
36+
echo "registry: $(npm config get registry)"
37+
echo "--- repo .npmrc ---"; [ -f .npmrc ] && cat .npmrc || echo "(none)"
38+
echo "--- user .npmrc ---"; [ -f ~/.npmrc ] && cat ~/.npmrc || echo "(none)"
39+
echo "--- publishConfig from @exactly/lib ---"
40+
node -e "const p=require('./package.json');console.log(p.publishConfig||'(none)')"
41+
echo "--- npm view (should succeed) ---"
42+
npx --yes npm@latest view @exactly/lib name version || true
2943
- uses: changesets/action@v1
3044
with:
3145
title: 🔖 new release
3246
publish: pnpm changeset publish
3347
setupGitUser: false
3448
env:
3549
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
36-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
NPM_CONFIG_ACCESS: public
51+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)