Skip to content

Commit fbc0313

Browse files
chore: add publish workflow
Reference: https://docs.npmjs.com/generating-provenance-statements
1 parent 2a29c4c commit fbc0313

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# reference: https://docs.npmjs.com/generating-provenance-statements
2+
3+
name: Publish
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
# expected format: <package>@<version> (example: socket.io@1.2.3)
11+
- '*@*'
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
id-token: write
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Use Node.js 20
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Publish package
33+
run: npm publish --workspace=${GITHUB_REF_NAME%@*} --provenance --access public
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)