feat: update desktop packaging workflow for self-hosted runners and improve artifact handling
This commit is contained in:
parent
8e5b6cc8ac
commit
31cdd4932b
|
|
@ -6,27 +6,36 @@ on:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "app/**"
|
||||||
|
- "app/.gitea/workflows/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bundle:
|
bundle:
|
||||||
name: Bundle (${{ matrix.name }})
|
name: Bundle (${{ matrix.name }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.runner_labels }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: app
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: Linux
|
- name: Linux
|
||||||
os: ubuntu-22.04
|
runner_labels: [self-hosted, linux, x64]
|
||||||
package_script: package:linux
|
package_script: package:linux
|
||||||
artifact_name: dusk-linux-bundles
|
artifact_name: dusk-linux-bundles
|
||||||
|
artifact_file: dusk-linux-bundles.tar.gz
|
||||||
- name: macOS
|
- name: macOS
|
||||||
os: macos-latest
|
runner_labels: [self-hosted, macos]
|
||||||
package_script: package:macos
|
package_script: package:macos
|
||||||
artifact_name: dusk-macos-bundles
|
artifact_name: dusk-macos-bundles
|
||||||
|
artifact_file: dusk-macos-bundles.tar.gz
|
||||||
- name: Windows
|
- name: Windows
|
||||||
os: windows-latest
|
runner_labels: [self-hosted, windows, x64]
|
||||||
package_script: package:windows
|
package_script: package:windows
|
||||||
artifact_name: dusk-windows-bundles
|
artifact_name: dusk-windows-bundles
|
||||||
|
artifact_file: dusk-windows-bundles.zip
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -43,6 +52,9 @@ jobs:
|
||||||
- name: Install Linux system dependencies
|
- name: Install Linux system dependencies
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
|
if command -v sudo >/dev/null 2>&1; then
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
libwebkit2gtk-4.1-dev \
|
libwebkit2gtk-4.1-dev \
|
||||||
|
|
@ -54,6 +66,22 @@ jobs:
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libayatana-appindicator3-dev \
|
libayatana-appindicator3-dev \
|
||||||
librsvg2-dev
|
librsvg2-dev
|
||||||
|
else
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
build-essential \
|
||||||
|
curl \
|
||||||
|
wget \
|
||||||
|
file \
|
||||||
|
libxdo-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libayatana-appindicator3-dev \
|
||||||
|
librsvg2-dev
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "apt-get not available; assuming Linux runner dependencies are preinstalled"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install frontend dependencies
|
- name: Install frontend dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
|
|
@ -61,9 +89,35 @@ jobs:
|
||||||
- name: Build Tauri bundles
|
- name: Build Tauri bundles
|
||||||
run: bun run ${{ matrix.package_script }}
|
run: bun run ${{ matrix.package_script }}
|
||||||
|
|
||||||
- name: Upload bundle artifacts
|
- name: Prepare artifact directory
|
||||||
|
run: mkdir -p ../ci-artifacts
|
||||||
|
|
||||||
|
- name: Create artifact archive (Linux/macOS)
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
test -d src-tauri/target/release/bundle
|
||||||
|
tar -C src-tauri/target/release -czf ../ci-artifacts/${{ matrix.artifact_file }} bundle
|
||||||
|
|
||||||
|
- name: Create artifact archive (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
if (!(Test-Path "src-tauri/target/release/bundle")) {
|
||||||
|
throw "Bundle output directory not found: src-tauri/target/release/bundle"
|
||||||
|
}
|
||||||
|
Compress-Archive -Path "src-tauri/target/release/bundle/*" -DestinationPath "../ci-artifacts/${{ matrix.artifact_file }}" -Force
|
||||||
|
|
||||||
|
- name: Upload bundle artifact (Gitea-compatible, best effort)
|
||||||
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.artifact_name }}
|
name: ${{ matrix.artifact_name }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
path: src-tauri/target/release/bundle/**
|
path: ci-artifacts/${{ matrix.artifact_file }}
|
||||||
|
|
||||||
|
- name: Print fallback artifact location on runner
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
echo "fallback artifacts directory on runner: ${GITHUB_WORKSPACE}/ci-artifacts"
|
||||||
|
ls -lah ../ci-artifacts
|
||||||
|
|
|
||||||
30
README.md
30
README.md
|
|
@ -295,19 +295,35 @@ common artifact types by platform:
|
||||||
cross-platform packaging is automated in:
|
cross-platform packaging is automated in:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
app/.github/workflows/desktop-packaging.yml
|
app/.gitea/workflows/desktop-packaging.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
workflow behavior:
|
workflow behavior:
|
||||||
|
|
||||||
- runs a matrix build on `ubuntu-22.04`, `macos-latest`, and `windows-latest`
|
- runs a matrix build on **self-hosted gitea runners** for linux, macos, and windows
|
||||||
|
- uses runner label sets:
|
||||||
|
- linux: `self-hosted`, `linux`, `x64`
|
||||||
|
- macos: `self-hosted`, `macos`
|
||||||
|
- windows: `self-hosted`, `windows`, `x64`
|
||||||
- installs bun + rust, then runs platform-specific packaging scripts from `app/package.json`
|
- installs bun + rust, then runs platform-specific packaging scripts from `app/package.json`
|
||||||
- uploads generated bundles from `app/src-tauri/target/release/bundle/**` as artifacts:
|
- archives bundles from `app/src-tauri/target/release/bundle/` into:
|
||||||
- `dusk-linux-bundles`
|
- `ci-artifacts/dusk-linux-bundles.tar.gz`
|
||||||
- `dusk-macos-bundles`
|
- `ci-artifacts/dusk-macos-bundles.tar.gz`
|
||||||
- `dusk-windows-bundles`
|
- `ci-artifacts/dusk-windows-bundles.zip`
|
||||||
|
- attempts artifact upload with `actions/upload-artifact` (best effort)
|
||||||
|
- always keeps a fallback copy in runner workspace at `ci-artifacts/` (printed in logs), so artifacts can still be collected when artifact-service compatibility differs across gitea setups
|
||||||
|
|
||||||
the workflow triggers on manual dispatch, version tags (`v*`), and pull requests that touch the app or packaging workflow.
|
workflow triggers:
|
||||||
|
|
||||||
|
- manual dispatch (`workflow_dispatch`)
|
||||||
|
- version tag pushes matching `v*`
|
||||||
|
- pull requests touching `app/**` (including packaging files)
|
||||||
|
|
||||||
|
runner assumptions:
|
||||||
|
|
||||||
|
- runners are provisioned and registered in gitea with the labels listed above
|
||||||
|
- linux runners either provide tauri system deps already, or support `apt-get` installation during the workflow
|
||||||
|
- macos/windows signing and notarization are not configured in this workflow; output installers are unsigned unless runner-side signing is added
|
||||||
|
|
||||||
## contributing
|
## contributing
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue