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
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:
@@ -17,6 +17,13 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://github.com/actions/checkout@v4
|
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
|
- name: Install root dependencies
|
||||||
env:
|
env:
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
|
|||||||
@@ -48,18 +48,30 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://github.com/actions/checkout@v4
|
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
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
run: |
|
run: |
|
||||||
|
apt-get update && apt-get install -y --no-install-recommends zip
|
||||||
npm ci
|
npm ci
|
||||||
cd server && npm ci
|
cd server && npm ci
|
||||||
|
|
||||||
- name: Install zip utility
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y zip
|
|
||||||
|
|
||||||
- name: Set CI release version
|
- name: Set CI release version
|
||||||
run: >
|
run: >
|
||||||
node tools/set-release-version.js
|
node tools/set-release-version.js
|
||||||
@@ -108,6 +120,22 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://github.com/actions/checkout@v4
|
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
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
@@ -136,8 +164,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$projectRoot = $PWD.ProviderPath
|
$projectRoot = $PWD.ProviderPath
|
||||||
$electronBuilderWorkspace = Join-Path $env:TEMP ([guid]::NewGuid().ToString('N'))
|
$electronBuilderWorkspace = Join-Path $env:TEMP ([guid]::NewGuid().ToString('N'))
|
||||||
$electronBuilderCache = Join-Path $electronBuilderWorkspace 'electron-builder-cache'
|
|
||||||
$electronCache = Join-Path $electronBuilderWorkspace 'electron-cache'
|
|
||||||
$locationPushed = $false
|
$locationPushed = $false
|
||||||
|
|
||||||
function Invoke-RoboCopy {
|
function Invoke-RoboCopy {
|
||||||
@@ -157,21 +183,27 @@ jobs:
|
|||||||
# electron-builder rejects junction-backed files during asar creation
|
# electron-builder rejects junction-backed files during asar creation
|
||||||
# because their resolved path sits outside the package root.
|
# because their resolved path sits outside the package root.
|
||||||
New-Item -ItemType Directory -Path $electronBuilderWorkspace | Out-Null
|
New-Item -ItemType Directory -Path $electronBuilderWorkspace | Out-Null
|
||||||
New-Item -ItemType Directory -Path $electronBuilderCache | Out-Null
|
|
||||||
New-Item -ItemType Directory -Path $electronCache | Out-Null
|
# Point electron-builder at the Electron binary already present
|
||||||
$env:ELECTRON_BUILDER_CACHE = $electronBuilderCache
|
# in the main workspace so the packaging workspace can skip it.
|
||||||
$env:ELECTRON_CACHE = $electronCache
|
$env:ELECTRON_OVERRIDE_DIST_PATH = Join-Path $projectRoot 'node_modules\electron\dist'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Copy-Item -Path (Join-Path $projectRoot 'package.json') -Destination (Join-Path $electronBuilderWorkspace 'package.json') -Force
|
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
|
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 'dist') (Join-Path $electronBuilderWorkspace 'dist')
|
||||||
Invoke-RoboCopy (Join-Path $projectRoot 'images') (Join-Path $electronBuilderWorkspace 'images')
|
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
|
Push-Location $electronBuilderWorkspace
|
||||||
$locationPushed = $true
|
$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) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "electron-builder failed with exit code $LASTEXITCODE"
|
throw "electron-builder failed with exit code $LASTEXITCODE"
|
||||||
}
|
}
|
||||||
@@ -217,9 +249,6 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci --omit=dev
|
|
||||||
|
|
||||||
- name: Download previous manifest
|
- name: Download previous manifest
|
||||||
env:
|
env:
|
||||||
GITEA_RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
GITEA_RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user