Skip to content

Commit 35c4cb5

Browse files
committed
ci: simplify npm publishing action to trigger on release
1 parent f00f0dc commit 35c4cb5

2 files changed

Lines changed: 36 additions & 29 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Node.js package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-npmjs:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up publishing to npmjs.com
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: '10.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- run: npm ci
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
21+
build-github-packages:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: Set up publishing to GitHub Packages
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: '10.x'
32+
registry-url: 'https://npm.pkg.github.com'
33+
- run: npm ci
34+
- run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)