Files
SnowLuma/.github/workflows/dev-build.yml
T
手瓜一十雪 db8f0bdf50 Disable linux-arm64 job in dev-build workflow
Temporarily comment out the linux-arm64 matrix entry in .github/workflows/dev-build.yml (name, os, target) to prevent the ARM64 job from running. Lines are commented rather than removed so the job can be re-enabled easily later.
2026-05-05 20:28:40 +08:00

118 lines
3.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Dev Build
on:
push:
branches:
- '**'
tags-ignore:
- 'v*'
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Delete old artifacts
uses: actions/github-script@v7
with:
script: |
let page = 1;
while (true) {
const { data: { artifacts } } = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
page,
});
if (artifacts.length === 0) break;
for (const artifact of artifacts) {
await github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
});
console.log(`Deleted artifact: ${artifact.name}`);
}
page++;
}
build:
needs: cleanup
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: win-x64
os: windows-latest
target: win32-x64
- name: linux-x64
os: ubuntu-latest
target: linux-x64
# - name: linux-arm64
# os: ubuntu-24.04-arm
# target: linux-arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.28.0
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Always builds the WebUI flavor — no separate "core-only" artifact.
- name: Build project
env:
SNOWLUMA_TARGET: ${{ matrix.target }}
run: pnpm run build:all
- name: Bundle runtime dependencies
working-directory: dist
run: npm install --omit=dev
# Naming convention:
# SnowLuma-dev-<arch>.zip|tar.gz – zero-install (node bundled)
# SnowLuma-dev-<arch>-lite.zip|tar.gz – user provides Node >= 22
- name: Package (windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path "dist\*" -DestinationPath "SnowLuma-dev-${{ matrix.name }}-lite.zip"
Copy-Item (Get-Command node).Source -Destination "dist\node.exe"
Compress-Archive -Path "dist\*" -DestinationPath "SnowLuma-dev-${{ matrix.name }}.zip"
- name: Package (linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
chmod +x dist/launcher.sh
tar -czf "SnowLuma-dev-${{ matrix.name }}-lite.tar.gz" -C dist .
cp "$(command -v node)" dist/node
chmod +x dist/node
tar -czf "SnowLuma-dev-${{ matrix.name }}.tar.gz" -C dist .
# Single upload step — glob picks up both variants (.zip on Windows,
# .tar.gz on Linux) for this matrix row.
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: SnowLuma-dev-${{ github.sha }}-${{ matrix.name }}
path: SnowLuma-dev-${{ matrix.name }}*
retention-days: 3
overwrite: true
if-no-files-found: error