Skip to content

Commit 57fb36c

Browse files
authored
Merge pull request RonRadtke#4 from RonRadtke/npm-publish-action
set up npm publish GitHub Action
2 parents 031aad3 + 2a673db commit 57fb36c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will publish a package to npm when a release is created.
2+
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
# TODO: add tests or leave them out, add build steps...?
5+
6+
name: npm publish
7+
8+
on:
9+
release:
10+
types: [created]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
- run: npm ci
21+
# - run: npm test
22+
23+
publish-npm:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: 16
31+
registry-url: https://registry.npmjs.org/
32+
- run: npm ci
33+
# - run: npm run build
34+
- run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)