Skip to content

Commit c8e76d0

Browse files
committed
fix: set up releasing with trusted publishing
1 parent b233ae2 commit c8e76d0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,22 @@ jobs:
1010
build:
1111
if: "!contains(github.event.commits[0].message, '[skip ci]')"
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
permissions:
15+
contents: write # to be able to publish a GitHub release
16+
issues: write # to be able to comment on released issues
17+
pull-requests: write # to be able to comment on released pull requests
18+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
1319

1420
steps:
1521
- uses: actions/checkout@v5
1622

23+
# because npm 10.8.2 (default) doesn't work with trusted publishing, 11.6.2 works
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 'lts/*'
28+
1729
- name: Install npm dependencies
1830
run: yarn install
1931

@@ -38,6 +50,5 @@ jobs:
3850
- name: Run automated release process with semantic-release
3951
if: github.event_name == 'push' && contains(github.ref, 'main')
4052
env:
41-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
42-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4354
run: yarn semantic-release

0 commit comments

Comments
 (0)