Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit e68624f

Browse files
committed
So crazy it just might work
1 parent b552ccb commit e68624f

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

.github/workflows/build.yml

+19-13
Original file line numberDiff line numberDiff line change
@@ -55,33 +55,39 @@ jobs:
5555
prebuild-test:
5656
strategy:
5757
matrix:
58-
os:
59-
- ubuntu-latest
60-
- macos-latest
61-
- windows-latest
58+
os_and_node:
59+
- { os: "ubuntu-latest", node: "18" }
60+
- { os: "macos-latest", node: "18" }
61+
- { os: "windows-2019", node: "14" }
6262
fail-fast: false
63-
name: Prebuild on ${{ matrix.os }}
64-
runs-on: ${{ matrix.os }}
63+
name: Prebuild on ${{ matrix.os_and_node.os }}
64+
runs-on: ${{ matrix.os_and_node.os }}
6565
steps:
6666
- uses: actions/checkout@v3
6767
with:
6868
submodules: true
6969
fetch-depth: 0
7070
- uses: actions/setup-node@v3
7171
with:
72-
node-version: 16
72+
node-version: ${{ matrix.os_and_node.node }}
7373
- name: Update node-gyp
74-
if: ${{ matrix.os == 'windows-latest' }}
75-
shell: powershell
74+
if: ${{ matrix.os_and_node.os == 'windows-2019' }}
7675
run: |
77-
npm install --global node-gyp@latest
78-
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
76+
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
77+
$NodeDirPath = Split-Path $WhereNode -Parent
78+
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\npm-lifecycle"
79+
cd $NodeModulesPath
80+
npm install node-gyp@latest
81+
npm config set msvs_version 2017
82+
npm config set msvs-version 2017
83+
npm config set msvs_version 2017 --global
84+
npm config set msvs-version 2017 --global
7985
- run: npm install --ignore-scripts
8086
- 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
8187
- run: npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0
82-
- if: matrix.os == 'windows-latest'
88+
- if: matrix.os_and_node.os == 'windows-2019'
8389
run: npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0 --arch ia32
84-
- if: matrix.os == 'macos-latest'
90+
- if: matrix.os_and_node.os == 'macos-latest'
8591
run: npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0 --arch arm64
8692

8793
publish:

0 commit comments

Comments
 (0)