Skip to content

Commit e0010ef

Browse files
committed
fix: set up releasing with trusted publishing
1 parent 1508e52 commit e0010ef

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/test-and-release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,30 @@ on:
99
jobs:
1010
test-and-release:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # to be able to publish a GitHub release
14+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
1215

1316
steps:
1417
- uses: actions/checkout@v5
1518
- uses: oven-sh/setup-bun@v2
1619

20+
# because npm 10.8.2 (default) doesn't work with trusted publishing, 11.6.2 works
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 'lts/*'
25+
1726
- run: bun install
1827

1928
- run: bun run test
2029

2130
- name: Run automated release process with semantic-release
2231
if: github.ref_name == 'main'
23-
uses: cycjimmy/semantic-release-action@v3
32+
uses: cycjimmy/semantic-release-action@v6
2433
with:
2534
extra_plugins: |
2635
@semantic-release/changelog
2736
@semantic-release/git
2837
env:
29-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
30-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)