Skip to content

Commit 6a65d62

Browse files
committed
Replace AppVeyor with GitHub Actions
1 parent 16f7319 commit 6a65d62

File tree

2 files changed

+104
-25
lines changed

2 files changed

+104
-25
lines changed

.appveyor.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
release:
11+
types:
12+
- released
13+
14+
jobs:
15+
16+
test:
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
- macos-latest
22+
- windows-latest
23+
node:
24+
- 14
25+
- 16
26+
- 18
27+
exclude:
28+
- os: windows-latest
29+
node: 16
30+
- os: windows-latest
31+
node: 18
32+
fail-fast: false
33+
name: Testing Node ${{ matrix.node }} on ${{ matrix.os }}
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v3
37+
with:
38+
submodules: true
39+
fetch-depth: 0
40+
- uses: actions/setup-node@v3
41+
with:
42+
node-version: ${{ matrix.node }}
43+
- name: Update node-gyp
44+
if: ${{ matrix.os == 'windows-latest' && matrix.node == '14' }}
45+
run: |
46+
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
47+
$NodeDirPath = Split-Path $WhereNode -Parent
48+
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\npm-lifecycle"
49+
cd $NodeModulesPath
50+
npm install [email protected]
51+
- run: npm install
52+
- run: npm test
53+
54+
publish:
55+
if: ${{ github.event_name == 'release' }}
56+
name: Publishing to NPM
57+
runs-on: ubuntu-latest
58+
needs: test
59+
steps:
60+
- uses: actions/checkout@v3
61+
with:
62+
submodules: true
63+
fetch-depth: 0
64+
- uses: actions/setup-node@v3
65+
with:
66+
node-version: 18
67+
registry-url: https://registry.npmjs.org
68+
- run: npm publish
69+
env:
70+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
71+
72+
prebuild:
73+
strategy:
74+
matrix:
75+
os:
76+
- ubuntu-latest
77+
- macos-latest
78+
- windows-latest
79+
name: Prebuild on ${{ matrix.os }}
80+
runs-on: ${{ matrix.os }}
81+
needs: publish
82+
steps:
83+
- uses: actions/checkout@v3
84+
with:
85+
submodules: true
86+
fetch-depth: 0
87+
- uses: actions/setup-node@v3
88+
with:
89+
node-version: 14
90+
- name: Update node-gyp
91+
if: ${{ matrix.os == 'windows-latest' && matrix.node == '14' }}
92+
run: |
93+
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
94+
$NodeDirPath = Split-Path $WhereNode -Parent
95+
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\npm-lifecycle"
96+
cd $NodeModulesPath
97+
npm install [email protected]
98+
- run: npm install --ignore-scripts
99+
- run: npx --no-install prebuild -r node -t 10.0.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 -t 18.0.0 -u ${{ secrets.GITHUB_TOKEN }}
100+
- run: npx --no-install prebuild -r electron -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 -u ${{ secrets.GITHUB_TOKEN }}
101+
- if: matrix.os == 'windows-latest'
102+
run: npx --no-install prebuild -r electron -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 --arch ia32 -u ${{ secrets.GITHUB_TOKEN }}
103+
- if: matrix.os == 'macos-latest'
104+
run: npx --no-install prebuild -r electron -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)