Skip to content

Commit 19391c9

Browse files
committed
splitting publish workflow into its own
1 parent 6886cf3 commit 19391c9

4 files changed

Lines changed: 35 additions & 8 deletions

File tree

.github/workflows/linux.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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: Publish to Linux
4+
name: Publish binary to Linux
55

66
on:
77
create:
@@ -29,14 +29,9 @@ jobs:
2929
node-version: ${{ matrix.node-version }}
3030
- name: install NPM dependencies and build native binary
3131
run: yarn
32+
- name: remove native built artifact before publishing
33+
run: rm native/index.node && rm native/artifacts.json && rm -rf native/target
3234
- name: Package native binary and upload to github
3335
run: npm run upload-binary
3436
env:
3537
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
- name: remove native/index.node before publishing
37-
run: rm native/index.node
38-
- name: Publish to NPM
39-
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc && npm publish --access=public
40-
if: ${{ matrix.node-version == '12.x' }}
41-
env:
42-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

.github/workflows/macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
node-version: ${{ matrix.node-version }}
3232
- name: install NPM dependencies and build native binary
3333
run: yarn
34+
- name: remove native built artifact before publishing
35+
run: rm native/index.node && rm native/artifacts.json && rm -rf native/target
3436
- name: Package native binary and upload to github
3537
run: npm run upload-binary
3638
env:

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Publish to NPM
5+
6+
on:
7+
create:
8+
tags:
9+
- v*
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
- name: install NPM dependencies only
23+
run: yarn install --ignore-scripts
24+
- run: yarn build:typescript
25+
- name: Publish to NPM
26+
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc && npm publish --access=public
27+
env:
28+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

.github/workflows/windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
node-version: ${{ matrix.node-version }}
3030
- name: install NPM dependencies and build native binary
3131
run: yarn
32+
- name: remove native built artifact before publishing
33+
run: rm native/index.node && rm native/artifacts.json && rm -rf native/target
3234
- name: Package native binary and upload to github
3335
run: npm run upload-binary
3436
env:

0 commit comments

Comments
 (0)