ci: Attempt to speed up build
Some checks failed
Queue Release Build / prepare (push) Successful in 50s
Deploy Web Apps / deploy (push) Failing after 7m46s
Queue Release Build / build-windows (push) Failing after 11m49s
Queue Release Build / build-linux (push) Successful in 34m1s
Queue Release Build / finalize (push) Has been skipped

This commit is contained in:
2026-04-12 03:19:51 +02:00
parent 391d9235f1
commit 878fd1c766
2 changed files with 52 additions and 16 deletions

View File

@@ -17,6 +17,13 @@ jobs:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Restore npm cache
uses: https://github.com/actions/cache@v4
with:
path: ~/AppData/Local/npm-cache
key: npm-windows-${{ hashFiles('package-lock.json', 'website/package-lock.json') }}
restore-keys: npm-windows-
- name: Install root dependencies
env:
NODE_ENV: development

View File

@@ -48,18 +48,30 @@ jobs:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Restore npm cache
uses: https://github.com/actions/cache@v4
with:
path: /root/.npm
key: npm-linux-${{ hashFiles('package-lock.json', 'server/package-lock.json') }}
restore-keys: npm-linux-
- name: Restore Electron cache
uses: https://github.com/actions/cache@v4
with:
path: |
/root/.cache/electron
/root/.cache/electron-builder
key: electron-linux-${{ hashFiles('package.json') }}
restore-keys: electron-linux-
- name: Install dependencies
env:
NODE_ENV: development
run: |
apt-get update && apt-get install -y --no-install-recommends zip
npm ci
cd server && npm ci
- name: Install zip utility
run: |
apt-get update
apt-get install -y zip
- name: Set CI release version
run: >
node tools/set-release-version.js
@@ -108,6 +120,22 @@ jobs:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Restore npm cache
uses: https://github.com/actions/cache@v4
with:
path: ~/AppData/Local/npm-cache
key: npm-windows-${{ hashFiles('package-lock.json', 'server/package-lock.json') }}
restore-keys: npm-windows-
- name: Restore Electron cache
uses: https://github.com/actions/cache@v4
with:
path: |
~/AppData/Local/electron/Cache
~/AppData/Local/electron-builder/Cache
key: electron-windows-${{ hashFiles('package.json') }}
restore-keys: electron-windows-
- name: Install dependencies
env:
NODE_ENV: development
@@ -136,8 +164,6 @@ jobs:
run: |
$projectRoot = $PWD.ProviderPath
$electronBuilderWorkspace = Join-Path $env:TEMP ([guid]::NewGuid().ToString('N'))
$electronBuilderCache = Join-Path $electronBuilderWorkspace 'electron-builder-cache'
$electronCache = Join-Path $electronBuilderWorkspace 'electron-cache'
$locationPushed = $false
function Invoke-RoboCopy {
@@ -157,21 +183,27 @@ jobs:
# electron-builder rejects junction-backed files during asar creation
# because their resolved path sits outside the package root.
New-Item -ItemType Directory -Path $electronBuilderWorkspace | Out-Null
New-Item -ItemType Directory -Path $electronBuilderCache | Out-Null
New-Item -ItemType Directory -Path $electronCache | Out-Null
$env:ELECTRON_BUILDER_CACHE = $electronBuilderCache
$env:ELECTRON_CACHE = $electronCache
# Point electron-builder at the Electron binary already present
# in the main workspace so the packaging workspace can skip it.
$env:ELECTRON_OVERRIDE_DIST_PATH = Join-Path $projectRoot 'node_modules\electron\dist'
try {
Copy-Item -Path (Join-Path $projectRoot 'package.json') -Destination (Join-Path $electronBuilderWorkspace 'package.json') -Force
Copy-Item -Path (Join-Path $projectRoot 'package-lock.json') -Destination (Join-Path $electronBuilderWorkspace 'package-lock.json') -Force
Invoke-RoboCopy (Join-Path $projectRoot 'dist') (Join-Path $electronBuilderWorkspace 'dist')
Invoke-RoboCopy (Join-Path $projectRoot 'images') (Join-Path $electronBuilderWorkspace 'images')
Invoke-RoboCopy (Join-Path $projectRoot 'node_modules') (Join-Path $electronBuilderWorkspace 'node_modules')
Push-Location $electronBuilderWorkspace
$locationPushed = $true
npx electron-builder --win --publish never
# Install only production dependencies — much faster than
# mirroring the full node_modules tree via robocopy and also
# avoids the junction/symlink issues that require the temp workspace.
npm ci --omit=dev --ignore-scripts
$electronBuilderBin = Join-Path $projectRoot 'node_modules\.bin\electron-builder.cmd'
& $electronBuilderBin --win --publish never
if ($LASTEXITCODE -ne 0) {
throw "electron-builder failed with exit code $LASTEXITCODE"
}
@@ -217,9 +249,6 @@ jobs:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Install dependencies
run: npm ci --omit=dev
- name: Download previous manifest
env:
GITEA_RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}