Skip to content

Commit 7fc04fd

Browse files
committed
chore: publish to npm and gpr
1 parent 6cbe629 commit 7fc04fd

File tree

2 files changed

+48
-22
lines changed

2 files changed

+48
-22
lines changed

.github/workflows/npm.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 14
15+
- run: npm ci
16+
- run: npm run lint
17+
- run: npm run test
18+
19+
publish-npm:
20+
needs: build
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 14
27+
registry-url: https://registry.npmjs.org/
28+
- run: npm ci
29+
- run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
32+
33+
publish-gpr:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
packages: write
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: actions/setup-node@v3
42+
with:
43+
node-version: 14
44+
registry-url: https://npm.pkg.github.com/
45+
- run: npm ci
46+
- run: npm publish
47+
env:
48+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)