124 lines
3.7 KiB
YAML
124 lines
3.7 KiB
YAML
name: Desktop Packaging
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
paths:
|
|
- "app/**"
|
|
- "app/.gitea/workflows/**"
|
|
|
|
jobs:
|
|
bundle:
|
|
name: Bundle (${{ matrix.name }})
|
|
runs-on: ${{ matrix.runner_labels }}
|
|
defaults:
|
|
run:
|
|
working-directory: app
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: Linux
|
|
runner_labels: [self-hosted, linux, x64]
|
|
package_script: package:linux
|
|
artifact_name: dusk-linux-bundles
|
|
artifact_file: dusk-linux-bundles.tar.gz
|
|
- name: macOS
|
|
runner_labels: [self-hosted, macos]
|
|
package_script: package:macos
|
|
artifact_name: dusk-macos-bundles
|
|
artifact_file: dusk-macos-bundles.tar.gz
|
|
- name: Windows
|
|
runner_labels: [self-hosted, windows, x64]
|
|
package_script: package:windows
|
|
artifact_name: dusk-windows-bundles
|
|
artifact_file: dusk-windows-bundles.zip
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install Linux system dependencies
|
|
if: runner.os == 'Linux'
|
|
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 install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
build-essential \
|
|
curl \
|
|
wget \
|
|
file \
|
|
libxdo-dev \
|
|
libssl-dev \
|
|
libayatana-appindicator3-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
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Build Tauri bundles
|
|
run: bun run ${{ matrix.package_script }}
|
|
|
|
- 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
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
if-no-files-found: error
|
|
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
|