Files
imager/.github/workflows/build-artifacts.yml

387 lines
11 KiB
YAML

name: Build Artifacts (No Release)
# Workflow to build and upload artifacts without creating releases
# Can be triggered manually from any branch
on:
workflow_dispatch:
inputs:
build_linux_x64:
description: 'Build Linux x64'
type: boolean
default: true
build_linux_arm64:
description: 'Build Linux ARM64'
type: boolean
default: true
build_macos:
description: 'Build macOS (x64 + ARM64)'
type: boolean
default: true
build_windows_x64:
description: 'Build Windows x64'
type: boolean
default: true
build_windows_arm64:
description: 'Build Windows ARM64'
type: boolean
default: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
NODE_VERSION: '20'
TAURI_CLI_VERSION: '^2'
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
jobs:
build-linux-x64:
name: Linux x64
if: ${{ inputs.build_linux_x64 }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libgtk-3-dev \
squashfs-tools \
xdg-utils
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Cache cargo bin (tauri-cli)
uses: actions/cache@v4
with:
path: ~/.cargo/bin
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-stable-${{ hashFiles('**/Cargo.lock') }}
- name: Install npm dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Install Tauri CLI (if missing)
shell: bash
run: |
if ! command -v cargo-tauri >/dev/null 2>&1; then
cargo install tauri-cli --version "${TAURI_CLI_VERSION}" --locked
fi
- name: Build Tauri app
run: cargo tauri build --bundles deb,appimage
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
retention-days: 30
build-linux-arm64:
name: Linux ARM64
if: ${{ inputs.build_linux_arm64 }}
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libgtk-3-dev \
squashfs-tools \
xdg-utils
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Cache cargo bin (tauri-cli)
uses: actions/cache@v4
with:
path: ~/.cargo/bin
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-stable-${{ hashFiles('**/Cargo.lock') }}
- name: Install npm dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Install Tauri CLI (if missing)
shell: bash
run: |
if ! command -v cargo-tauri >/dev/null 2>&1; then
cargo install tauri-cli --version "${TAURI_CLI_VERSION}" --locked
fi
- name: Build Tauri app
run: cargo tauri build --bundles deb,appimage
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-arm64
path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
retention-days: 30
build-macos:
name: macOS (${{ matrix.arch }})
if: ${{ inputs.build_macos }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
arch: x64
os: macos-15
- target: aarch64-apple-darwin
arch: arm64
os: macos-latest
runs-on: ${{ matrix.os }}
env:
APPLE_SIGNING_IDENTITY: "-"
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Setup Rust (add target)
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: macos-${{ matrix.target }}
- name: Cache cargo bin (tauri-cli)
uses: actions/cache@v4
with:
path: ~/.cargo/bin
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-stable-${{ hashFiles('**/Cargo.lock') }}
- name: Install npm dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Install Tauri CLI (if missing)
shell: bash
run: |
if ! command -v cargo-tauri >/dev/null 2>&1; then
cargo install tauri-cli --version "${TAURI_CLI_VERSION}" --locked
fi
- name: Build Tauri app
shell: bash
run: |
cargo tauri build --target "${{ matrix.target }}" --bundles dmg,app
- name: Zip .app bundle
shell: bash
env:
CARGO_TARGET_DIR: src-tauri/target/${{ matrix.target }}
run: |
set -euo pipefail
shopt -s nullglob
for app in "$CARGO_TARGET_DIR/release/bundle/macos/"*.app; do
base="$(basename "$app" .app)"
ditto -c -k --sequesterRsrc --keepParent "$app" "$CARGO_TARGET_DIR/release/bundle/macos/${base}-${{ matrix.arch }}.app.zip"
done
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.arch }}
path: |
src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.zip
src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
retention-days: 30
build-windows-x64:
name: Windows x64
if: ${{ inputs.build_windows_x64 }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Cache cargo bin (tauri-cli)
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~\.cargo\bin
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-stable-${{ hashFiles('**/Cargo.lock') }}
- name: Install npm dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Install Tauri CLI (if missing)
shell: bash
run: |
if ! command -v cargo-tauri >/dev/null 2>&1; then
cargo install tauri-cli --version "${TAURI_CLI_VERSION}" --locked
fi
- name: Build Tauri app
run: cargo tauri build --target x86_64-pc-windows-msvc --bundles msi,nsis
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-x64
path: |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe
retention-days: 30
build-windows-arm64:
name: Windows ARM64
if: ${{ inputs.build_windows_arm64 }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-pc-windows-msvc
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Cache cargo bin (tauri-cli)
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~\.cargo\bin
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-stable-${{ hashFiles('**/Cargo.lock') }}
- name: Install npm dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Install Tauri CLI (if missing)
shell: bash
run: |
if ! command -v cargo-tauri >/dev/null 2>&1; then
cargo install tauri-cli --version "${TAURI_CLI_VERSION}" --locked
fi
- name: Build Tauri app
run: cargo tauri build --target aarch64-pc-windows-msvc --bundles msi,nsis
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-arm64
path: |
src-tauri/target/aarch64-pc-windows-msvc/release/bundle/msi/*.msi
src-tauri/target/aarch64-pc-windows-msvc/release/bundle/nsis/*.exe
retention-days: 30
summary:
name: Build Summary
needs:
- build-linux-x64
- build-linux-arm64
- build-macos
- build-windows-x64
- build-windows-arm64
if: always()
runs-on: ubuntu-latest
steps:
- name: Check build results
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Linux x64 | ${{ needs.build-linux-x64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Linux ARM64 | ${{ needs.build-linux-arm64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| macOS | ${{ needs.build-macos.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Windows x64 | ${{ needs.build-windows-x64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Windows ARM64 | ${{ needs.build-windows-arm64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Artifacts are available for download for 30 days." >> $GITHUB_STEP_SUMMARY