diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc90de534..b77cc031c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,6 +47,40 @@ jobs: - name: Install dependencies run: pnpm install + env: + VORTEX_ELECTRON_REBUILD: "defer" + + - name: Cache native build headers + uses: actions/cache@v4 + with: + path: | + ~/.electron-gyp + ~/.cache/node-gyp + key: native-headers-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'pnpm-lock.yaml') }} + + - name: Cache Electron native rebuild outputs + id: electron-native-cache + uses: actions/cache@v4 + with: + path: | + node_modules/.pnpm/@nexusmods+fomod-installer-native@*/node_modules/@nexusmods/fomod-installer-native/build + node_modules/.pnpm/@nexusmods+fomod-installer-native@*/node_modules/@nexusmods/fomod-installer-native/bin + node_modules/.pnpm/drivelist@*/node_modules/drivelist/build + node_modules/.pnpm/drivelist@*/node_modules/drivelist/bin + node_modules/.pnpm/leveldown@*/node_modules/leveldown/build + node_modules/.pnpm/leveldown@*/node_modules/leveldown/bin + node_modules/.pnpm/winapi-bindings@*/node_modules/winapi-bindings/build + node_modules/.pnpm/winapi-bindings@*/node_modules/winapi-bindings/bin + node_modules/.pnpm/xxhash-addon@*/node_modules/xxhash-addon/build + node_modules/.pnpm/xxhash-addon@*/node_modules/xxhash-addon/bin + node_modules/.pnpm/@parcel+watcher@*/node_modules/@parcel/watcher/build + node_modules/.pnpm/@parcel+watcher@*/node_modules/@parcel/watcher/bin + key: electron-native-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'src/main/postinstall.mjs') }} + + - name: Rebuild Electron native modules + run: | + echo "Electron native cache hit: ${{ steps.electron-native-cache.outputs.cache-hit }}" + pnpm --filter @vortex/main exec electron-rebuild - name: Build run: pnpm run build