Skip to content

Commit 3c877a4

Browse files
Update build.yml
1 parent a372bd7 commit 3c877a4

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,36 @@ jobs:
2121
with:
2222
node-version: '20.18.1'
2323

24-
- name: Install Python
25-
uses: actions/setup-python@v4
24+
- name: Cache Yarn
25+
id: yarn-cache
26+
uses: actions/cache@v3
2627
with:
27-
python-version: '3.9'
28-
29-
- name: Install Visual Studio Build Tools
30-
run: npm install -g windows-build-tools@5.2.2
31-
shell: pwsh
28+
path: |
29+
~/AppData/Local/Yarn/Cache
30+
~/AppData/Roaming/npm-cache
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-yarn-
34+
35+
- name: Install Yarn
36+
run: npm install -g yarn && yarn config set ignore-engines true
37+
38+
- name: Cache node_modules
39+
id: node-modules-cache
40+
uses: actions/cache@v3
41+
with:
42+
path: node_modules
43+
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-node-modules-
46+
47+
- name: Install node-gyp with patch
48+
run: npm install -g node-gyp --build-from-source
3249

33-
- name: Set up node-gyp environment
34-
run: |
35-
npm config set python "$(which python)"
36-
npm config set msvs_version 2019
37-
shell: bash
3850

3951
- name: Install dependencies
40-
run: yarn install --frozen-lockfile
41-
42-
- name: Force node-gyp rebuild
43-
run: yarn rebuild --arch=x64
44-
shell: bash
52+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
53+
run: yarn install
4554

4655
- name: Run build script
4756
run: .\build.bat

0 commit comments

Comments
 (0)