Skip to content

Commit aefc40b

Browse files
committed
Move the electron-builder cache out of the checkout, and repin pnpm's action
1 parent c90c9fb commit aefc40b

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
timeout-minutes: 15
1818
steps:
1919
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
20-
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.4.0
20+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
2121
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
2222
with:
2323
node-version: 24
@@ -43,23 +43,25 @@ jobs:
4343
os: [ubuntu-latest, windows-latest, macos-latest]
4444
runs-on: ${{ matrix.os }}
4545
timeout-minutes: 30
46-
env:
47-
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.electron-builder-cache
4846
steps:
4947
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
50-
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.4.0
48+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
5149
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
5250
with:
5351
node-version: 24
5452
cache: pnpm
5553
# The Electron runtime is a 130-200 MB download per platform, and it changes only when the pin does.
5654
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
5755
with:
58-
path: ${{ github.workspace }}/.electron-builder-cache
56+
path: ${{ runner.temp }}/electron-builder-cache
5957
key: electron-builder-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
6058
# Unlike the verify job this one runs install scripts: esbuild's binary is what builds the shell.
6159
- run: pnpm install --frozen-lockfile
60+
# The cache stays outside the checkout: electron-builder downloads helper tools into it as CommonJS, and
61+
# the root package.json's `type: module` governs the whole tree, so Node would load them as ESM and fail.
6262
- run: pnpm --filter @zax/app package
63+
env:
64+
ELECTRON_BUILDER_CACHE: ${{ runner.temp }}/electron-builder-cache
6365
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6466
with:
6567
name: zax-${{ runner.os }}

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,16 @@ jobs:
2828
timeout-minutes: 30
2929
permissions:
3030
contents: read
31-
env:
32-
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.electron-builder-cache
3331
steps:
3432
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
35-
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.4.0
33+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
3634
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
3735
with:
3836
node-version: 24
3937
cache: pnpm
4038
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
4139
with:
42-
path: ${{ github.workspace }}/.electron-builder-cache
40+
path: ${{ runner.temp }}/electron-builder-cache
4341
key: electron-builder-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
4442
- run: pnpm install --frozen-lockfile
4543
# The tag is what names the release; a tag whose version does not match the manifest would produce
@@ -49,7 +47,11 @@ jobs:
4947
env:
5048
TAG: ${{ github.ref_name }}
5149
run: ./.github/scripts/check-tag-version.sh
50+
# The cache stays outside the checkout: electron-builder downloads helper tools into it as CommonJS, and
51+
# the root package.json's `type: module` governs the whole tree, so Node would load them as ESM and fail.
5252
- run: pnpm --filter @zax/app package
53+
env:
54+
ELECTRON_BUILDER_CACHE: ${{ runner.temp }}/electron-builder-cache
5355
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5456
with:
5557
name: zax-${{ runner.os }}

0 commit comments

Comments
 (0)