Skip to content

Commit c900fef

Browse files
committed
Configure NPM trusted publisher
- Merge `prereleased.yaml` and `release.yaml` into one `publish.yaml`, because NPM supports only one trusted publisher. - Publish package with the `next` tag if release event type is `prereleased`.
1 parent e79552a commit c900fef

2 files changed

Lines changed: 7 additions & 43 deletions

File tree

.github/workflows/prerelease.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
name: Release
1+
name: Publish
22
on:
33
release:
4-
types: [released]
4+
types: [prereleased, released]
5+
6+
permissions:
7+
id-token: write # Required for OIDC
8+
contents: read
59

610
jobs:
711
npm:
@@ -23,13 +27,8 @@ jobs:
2327
- name: Run linters
2428
run: npm run lint:build
2529

26-
- name: Run tests
27-
run: npm run test:build
28-
2930
- name: Build package
3031
run: npm run dist
3132

3233
- name: Publish package
33-
run: npm publish ./dist
34-
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
run: npm publish ${{ github.event.action == 'prereleased' && '--tag next' || '' }} ./dist

0 commit comments

Comments
 (0)