Skip to content

Commit 93aecd2

Browse files
committed
npm publish ci using provenance
1 parent 281b250 commit 93aecd2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/publish-npm.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Package to NPM
2+
on:
3+
release:
4+
types: [ published ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
steps:
14+
- name: update apt repository
15+
run: sudo apt-get update
16+
- name: Install ffmpeg
17+
run: sudo apt-get install -y libavcodec-dev libavutil-dev libavformat-dev
18+
- uses: actions/checkout@v4
19+
# Setup .npmrc file to publish to npm
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
registry-url: 'https://registry.npmjs.org'
24+
- run: npm ci
25+
- run: npm run build --if-present
26+
- run: npm publish --provenance --access public
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)