Skip to content

Commit 7608469

Browse files
committed
fix: git action
1 parent 3705549 commit 7608469

1 file changed

Lines changed: 24 additions & 29 deletions

File tree

.github/workflows/electron-build.yml

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,64 +13,59 @@ jobs:
1313
matrix:
1414
include:
1515
# - os: windows-latest
16-
# platform: win
16+
# script: electron:build:win
1717
# artifact: dist/*.exe
1818
- os: macos-latest
19-
platform: mac
19+
script: electron:build:mac
2020
artifact: dist/*.dmg
2121
- os: ubuntu-latest
22-
platform: linux
22+
script: electron:build:linux
2323
artifact: dist/*.AppImage
2424

2525
runs-on: ${{ matrix.os }}
2626

27-
# Point electron + electron-builder at workspace-relative dirs so the
28-
# cache path is identical on all platforms (no OS-specific %APPDATA% etc.)
29-
env:
30-
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
31-
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder
32-
3327
steps:
3428
- uses: actions/checkout@v4
3529

36-
# Caches ~/.npm tarballs — speeds up npm ci downloads without the
37-
# overhead of restoring 1.6 GB of node_modules from cache
3830
- uses: actions/setup-node@v4
3931
with:
4032
node-version: '22'
41-
cache: 'npm'
33+
34+
# Cache node_modules keyed on the lockfile — skips npm install entirely on hit
35+
- uses: actions/cache@v4
36+
id: cache-deps
37+
with:
38+
path: node_modules
39+
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
4240

4341
- name: Install Python setuptools (node-gyp needs distutils, removed in Python 3.12)
42+
if: steps.cache-deps.outputs.cache-hit != 'true'
4443
run: pip3 install setuptools --break-system-packages
4544

4645
- name: Install dependencies
46+
if: steps.cache-deps.outputs.cache-hit != 'true'
4747
run: npm ci
4848

49-
# Nuxt build output is only ~17 MB and platform-independent.
50-
# Key has no runner.os: whichever runner builds first, the other two restore and skip.
51-
- uses: actions/cache@v4
52-
id: cache-nuxt
53-
with:
54-
path: .output
55-
key: nuxt-${{ hashFiles('app/**', 'server/**', 'nuxt.config.ts', 'package-lock.json') }}
49+
# On cache hit npm ci (and its postinstall: nuxt prepare) was skipped — run it manually
50+
- name: Prepare Nuxt types
51+
if: steps.cache-deps.outputs.cache-hit == 'true'
52+
run: npx nuxt prepare
5653

57-
- name: Build Nuxt
58-
if: steps.cache-nuxt.outputs.cache-hit != 'true'
59-
run: npx nuxt build
60-
61-
# Electron binary + electron-builder tools (~200 MB per platform)
54+
# Cache the Electron and electron-builder download caches (~100-200 MB per arch)
6255
- uses: actions/cache@v4
6356
with:
6457
path: |
65-
${{ github.workspace }}/.cache/electron
66-
${{ github.workspace }}/.cache/electron-builder
58+
~/.cache/electron
59+
~/.cache/electron-builder
60+
${{ env.LOCALAPPDATA }}\electron\Cache
61+
${{ env.LOCALAPPDATA }}\electron-builder\Cache
6762
key: ${{ runner.os }}-electron-${{ hashFiles('package-lock.json') }}
6863
restore-keys: |
6964
${{ runner.os }}-electron-
70-
71-
- name: Package with electron-builder
72-
run: npx electron-builder --${{ matrix.platform }} --publish never
65+
- name: Build
66+
run: npm run ${{ matrix.script }}
7367
env:
68+
# electron-builder uses this to skip code signing in CI
7469
CSC_IDENTITY_AUTO_DISCOVERY: false
7570
# Mac notarization — set these in GitHub repo secrets if you need signed builds
7671
# APPLE_ID: ${{ secrets.APPLE_ID }}

0 commit comments

Comments
 (0)