-
Notifications
You must be signed in to change notification settings - Fork 4
31 lines (27 loc) · 835 Bytes
/
publish.yml
File metadata and controls
31 lines (27 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Publish package to npm (trusted publisher)
on:
push:
branches:
- main
permissions:
id-token: write # required for npm trusted publisher (OIDC)
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Use latest npm (trusted publisher support)
run: npm install -g npm@latest
- name: Clean npm auth config
run: |
npm config delete //registry.npmjs.org/:_authToken || true
npm config delete always-auth || true
- run: npm ci
- run: npm run build
# OIDC auth: no token needed when using trusted publishers
- run: npm publish --provenance --access public