Skip to content

Commit 86f2f3c

Browse files
committed
add publish workflow
1 parent 07efd95 commit 86f2f3c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/publish.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch:
7+
8+
jobs:
9+
chrome-tests:
10+
uses: ./.github/workflows/tests.yml
11+
publish:
12+
needs: [chrome-tests]
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: '21.x'
22+
registry-url: 'https://registry.npmjs.org'
23+
- uses: pnpm/action-setup@v2
24+
name: Install pnpm
25+
with:
26+
version: 8
27+
run_install: true
28+
- name: Build
29+
run: pnpm build
30+
- name: Pack
31+
run: rm -f *.tgz && npm pack
32+
- name: Publish
33+
run: npm publish *.tgz --provenance
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)