Skip to content

Commit 6907581

Browse files
committed
chore(release): switch to npm trusted publishing
1 parent 73a5d75 commit 6907581

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.github/workflows/release-manual.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
jobs:
55
release:
66
runs-on: ubuntu-latest
7+
permissions:
8+
id-token: write # Required for trusted publishing via OIDC (https://docs.npmjs.com/trusted-publishers)
79
steps:
810
- uses: actions/checkout@v4
911
with:
@@ -19,9 +21,4 @@ jobs:
1921
run: yarn build
2022

2123
- name: Publish to NPM
22-
run: |
23-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
24-
echo ":::: Publishing as $(npm whoami)"
25-
npm run release:publish-manual
26-
env:
27-
NPM_TOKEN: ${{ secrets.NPM_RELEASE_AUTH_TOKEN }}
24+
run: npm run release:publish-manual

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
jobs:
66
release:
77
runs-on: ubuntu-latest
8+
permissions:
9+
id-token: write # Required for trusted publishing via OIDC (https://docs.npmjs.com/trusted-publishers)
810
if: "contains(github.event.head_commit.message, 'chore(release): publish')"
911
steps:
1012
- uses: actions/checkout@v4
@@ -21,9 +23,4 @@ jobs:
2123
run: yarn build
2224

2325
- name: Publish to NPM
24-
run: |
25-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
26-
echo ":::: Publishing as $(npm whoami)"
27-
npm run release:publish
28-
env:
29-
NPM_TOKEN: ${{ secrets.NPM_RELEASE_AUTH_TOKEN }}
26+
run: npm run release:publish

0 commit comments

Comments
 (0)