Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit ed87448

Browse files
committed
updated release workflow
1 parent 2d31094 commit ed87448

File tree

3 files changed

+44
-40
lines changed

3 files changed

+44
-40
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ jobs:
5050
fail-fast: false
5151
matrix:
5252
build:
53-
- { os: ubuntu-latest, output: linux-x86_64.node }
54-
- { os: macos-latest, output: darwin-x86_64.node }
53+
- { os: ubuntu-latest, output: linux.node }
54+
- { os: macos-latest, output: darwin.node }
55+
- { os: windows-latest, output: win32.node }
5556
steps:
56-
- name: set NPM_CONFIG_PREFIX
57-
run: |
58-
echo "NPM_CONFIG_PREFIX=$HOME/.npm-global" >> $GITHUB_ENV
57+
- name: install wget
58+
if: runner.os == 'Windows'
59+
shell: bash
60+
run: choco install wget --no-progress
5961

6062
- name: checkout
6163
uses: actions/checkout@v2
@@ -67,6 +69,7 @@ jobs:
6769
path: artifact-env
6870

6971
- name: load env artifact
72+
shell: bash
7073
run: cat artifact-env/artifact-env >> $GITHUB_ENV
7174

7275
- name: install node
@@ -82,33 +85,20 @@ jobs:
8285
toolchain: stable
8386
override: true
8487

85-
- name: configure NPM_CONFIG_PREFIX
86-
run: |
87-
npm config set prefix $NPM_CONFIG_PREFIX
88-
mkdir -p $NPM_CONFIG_PREFIX/bin
89-
mkdir -p $NPM_CONFIG_PREFIX/lib
90-
echo "$NPM_CONFIG_PREFIX/bin" >> $GITHUB_PATH
91-
92-
- name: install node-gyp
88+
- name: build
89+
shell: bash
9390
run: |
94-
npm install -g node-gyp
95-
echo $PATH
96-
which node-gyp
97-
98-
- name: npm install
99-
run: npm install --ignore-scripts
91+
make setup
92+
make download-cpp-bindings
93+
make generate-node-bindings
10094
101-
- name: configure
102-
run: |
103-
make update-cpp-bindings
104-
make generate-bindings
10595
make configure
96+
make build
10697
107-
- name: build
108-
run: make build
109-
110-
- name: run tests
111-
run: make test
98+
- name: Run tests
99+
shell: bash
100+
run: |
101+
make test
112102
113103
- name: upload assets
114104
uses: actions/upload-release-asset@v1.0.1
@@ -143,14 +133,20 @@ jobs:
143133
- name: download linux artifact
144134
uses: actions/download-artifact@v1
145135
with:
146-
name: linux-x86_64.node
147-
path: linux-x86_64.node
136+
name: linux.node
137+
path: linux.node
148138

149139
- name: download macos artifact
150140
uses: actions/download-artifact@v1
151141
with:
152-
name: darwin-x86_64.node
153-
path: darwin-x86_64.node
142+
name: darwin.node
143+
path: darwin.node
144+
145+
- name: download windows artifact
146+
uses: actions/download-artifact@v1
147+
with:
148+
name: win32.node
149+
path: win32.node
154150

155151
- name: download env artifact
156152
uses: actions/download-artifact@v1
@@ -163,11 +159,13 @@ jobs:
163159

164160
- name: build package
165161
run: |
166-
ls -l linux-x86_64.node/
167-
ls -l darwin-x86_64.node/
162+
ls -l linux.node/
163+
ls -l darwin.node/
164+
ls -l win32.node/
168165
169-
cp linux-x86_64.node/ruby_parser.node pkg/linux-x86_64.node
170-
cp darwin-x86_64.node/ruby_parser.node pkg/darwin-x86_64.node
166+
cp linux.node/ruby_parser.node pkg/linux.node
167+
cp darwin.node/ruby_parser.node pkg/darwin.node
168+
cp win32.node/ruby_parser.node pkg/win32.node
171169
cp LICENSE pkg/
172170
cp README.md pkg/
173171
cd pkg
@@ -200,7 +198,7 @@ jobs:
200198
fail-fast: false
201199
matrix:
202200
node: [ '10', '12', '14', '15' ]
203-
os: [ ubuntu-latest, macos-latest ]
201+
os: [ ubuntu-latest, macos-latest, windows-latest ]
204202
steps:
205203
- name: checkout
206204
uses: actions/checkout@v2
@@ -218,6 +216,7 @@ jobs:
218216
path: artifact-env
219217

220218
- name: load env artifact
219+
shell: bash
221220
run: cat artifact-env/artifact-env >> $GITHUB_ENV
222221

223222
- name: download .tgz artifact
@@ -227,6 +226,7 @@ jobs:
227226
path: lib-ruby-parser-${{ env.GITHUB_TAG }}.tgz
228227

229228
- name: test
229+
shell: bash
230230
run: |
231231
mkdir test
232232
cd test

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
name: run tests
1616
runs-on: ${{ matrix.os }}
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
node: [ '10', '12', '14', '15' ]
2021
os: [ ubuntu-latest, macos-latest, windows-latest ]

pkg/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
switch (process.platform) {
22
case 'linux':
3-
module.exports = require('./linux-x86_64.node');
3+
module.exports = require('./linux.node');
44
break;
55
case 'darwin':
6-
module.exports = require('./darwin-x86_64.node')
6+
module.exports = require('./darwin.node')
7+
break;
8+
case 'win32':
9+
module.exports = require('./win32.node');
710
break;
811
default:
9-
throw new Error(`unsupported process.platform '${process.platform}' (only 'linux' and 'darwin' are supported)`);
12+
throw new Error(`unsupported process.platform '${process.platform}' (only 'linux', 'darwin' and 'win32' are supported)`);
1013
}

0 commit comments

Comments
 (0)