Skip to content

Commit 656c578

Browse files
committed
changed workflow for automatic artifact publishing and NPM publish
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
1 parent b8aa1f9 commit 656c578

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/nodejs.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Releases cross platform binaries for nodejs-snowflake
4+
name: Releases cross platform binaries for nodejs-snowflake and publishes to NPM
55

66
on:
77
push:
8-
branches: [master]
8+
tags:
9+
- '*'
910

1011
jobs:
1112
build:
1213
strategy:
1314
matrix:
1415
os: [ubuntu-latest, windows-latest, macos-latest]
15-
node-version: [12.17.0]
16+
node-version: [12.17.0, 14.16.0]
1617
runs-on: ${{ matrix.os }}
1718
steps:
1819
- uses: actions/checkout@v2
1920
- name: Use Node.js ${{ matrix.node-version }}
2021
uses: actions/setup-node@v1
2122
with:
2223
node-version: ${{ matrix.node-version }}
24+
- name: Install Dependencies
25+
- run: npm ci
26+
27+
- name: Build NodeJS Snowflake
28+
- run: npm run build
29+
30+
- name: Run Tests
31+
- run: npm t
32+
33+
- name: Publish artifacts on Github
2334
- run: |
24-
npm i
2535
npm i -g prebuild
26-
prebuild --all -r napi -u ${{ secrets.GITHUB_TOKEN }}
36+
prebuild --all -r napi -u ${{ secrets.GITHUB_TOKEN }} --strip
37+
38+
- name: Publish Package to NPM
39+
- uses: JS-DevTools/npm-publish@v1
40+
with:
41+
token: ${{ secrets.NPM_TOKEN }}
42+
tag: ${GITHUB_REF##*/}
43+

0 commit comments

Comments
 (0)