Skip to content

Commit 946001c

Browse files
author
Jagveer
committed
automated npm publishing
1 parent 833ffff commit 946001c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/npmpublish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [8.x, 10.x, 12.x]
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: npm install, build, and test
24+
run: |
25+
npm i -g yarn
26+
yarn install
27+
yarn test
28+
env:
29+
CI: true
30+
31+
publish:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v1
36+
- uses: actions/setup-node@v1
37+
with:
38+
node-version: 12
39+
registry-url: https://registry.npmjs.org/
40+
- name: yarn publish
41+
run: |
42+
npm i -g yarn
43+
yarn config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
44+
yarn publish
45+
env:
46+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
47+
CI: true

0 commit comments

Comments
 (0)