Skip to content

Commit 318f361

Browse files
committed
fix: ci npm publish
1 parent a4f80b7 commit 318f361

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,31 @@ on:
66
branches:
77
- 'main'
88

9+
permissions:
10+
contents: write # to be able to publish a GitHub release
11+
issues: write # to be able to comment on released issues
12+
pull-requests: write # to be able to comment on released pull requests
13+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
14+
915
jobs:
1016
publish:
1117
runs-on: ubuntu-latest
1218
env:
1319
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1520
steps:
1621
- name: Checkout
17-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
registry-url: 'https://registry.npmjs.org/'
1827
- name: Install
1928
run: yarn install --frozen-lockfile
2029
- name: Build
2130
run: yarn build
2231
- name: Release
2332
run: yarn release
33+
- name: Configure npm for OIDC
34+
run: npm install -g npm@11.6.1
35+
- name: Publish to npm with OIDC
36+
run: npm publish

.releaserc.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,19 @@
1111
"@semantic-release/commit-analyzer",
1212
"@semantic-release/release-notes-generator",
1313
"@semantic-release/changelog",
14-
"@semantic-release/npm",
15-
"@semantic-release/git",
16-
"@semantic-release/github"
14+
[
15+
"@semantic-release/npm",
16+
{
17+
"npmPublish": false
18+
}
19+
],
20+
"@semantic-release/github",
21+
[
22+
"@semantic-release/git",
23+
{
24+
"assets": ["package.json"],
25+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
26+
}
27+
]
1728
]
1829
}

0 commit comments

Comments
 (0)