Handy/.github/workflows/build.yml
CJ Pais a3015026a0
whisper-rs 0.16.0 and ort.rc12 (#1041)
* test build for 0.16.0

* macos 10.15?

* format

* shorter dir for build on windows?

* Update build.yml

* move

* Update build.yml

* long path support

* clang

* try

* try

* move to ort rc12

* use ms prebuilt?

* use lower version for 1.23.1

* download my prebuilt

* Update build.yml

* Update build.yml

* fix?

* fix(nix): use dynamic linking for ort-sys 2.0.0-rc.12

ort-sys rc.12 removed pkg-config support; without ORT_PREFER_DYNAMIC_LINK
it defaults to static linking against ORT_LIB_LOCATION, which fails
because nixpkgs only provides shared libraries (.so).

* fix(nix): override onnxruntime to 1.24.2 for ort-sys rc.12 compatibility

ort 2.0.0-rc.12 enables API v24 by default, but nixpkgs only ships
onnxruntime 1.23.2 (API v23), causing a runtime panic on model load.

Use Microsoft's prebuilt binaries for onnxruntime 1.24.2 via overlay,
patched with autoPatchelfHook for NixOS compatibility.

This overlay should be removed once nixpkgs merges onnxruntime ≥ 1.24:
https://github.com/NixOS/nixpkgs/pull/499389

* updated deps for whisper

* fix(nix): sync devShell with packages for ort-sys rc.12 compatibility

- Extract shared definitions (commonNativeDeps, gstPlugins, commonEnv,
  onnxruntimeOverlay) to avoid duplication between packages and devShells
- Add onnxruntime 1.24.2 overlay to devShell (was only in packages)
- Add BINDGEN_EXTRA_CLANG_ARGS to devShell so bindgen can find stdio.h
  and generate correct vulkan bindings for whisper-rs-sys
- Add ORT_LIB_LOCATION and ORT_PREFER_DYNAMIC_LINK to devShell
- Replace libappindicator with libayatana-appindicator in devShell
- Add onnxruntime and vulkan-loader to devShell LD_LIBRARY_PATH

* fix missing lib in the handy blob dl

* scope lib verification

* dont run bun2nix on windows

---------

Co-authored-by: Evgeny <evgeny.khudoba@yandex.ru>
2026-03-19 15:00:51 +08:00

480 lines
22 KiB
YAML

name: "Build"
on:
workflow_call:
inputs:
platform:
required: true
type: string
target:
required: true
type: string
build-args:
required: false
type: string
default: ""
release-id:
required: false
type: string
asset-prefix:
required: false
type: string
default: "handy"
asset-name-pattern:
required: false
type: string
default: ""
upload-artifacts:
required: false
type: boolean
default: false
sign-binaries:
required: false
type: boolean
default: false
repository:
required: false
type: string
ref:
required: false
type: string
default: ${{ github.ref }}
is-debug-build:
required: false
type: boolean
default: false
env:
TSC_VERSION: "0.9.0"
jobs:
build:
permissions:
contents: write
runs-on: ${{ inputs.platform }}
steps:
- name: Enable long paths (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
git config --system core.longpaths true
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Get version from tauri.conf.json
id: get-version
shell: bash
run: |
VERSION=$(grep -o '"version": "[^"]*"' src-tauri/tauri.conf.json | cut -d'"' -f4)
echo "Application version from tauri.conf.json: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Determine build profile
id: build-profile
shell: bash
run: |
if [[ "${{ inputs.is-debug-build }}" == "true" ]]; then
echo "profile=debug" >> "$GITHUB_OUTPUT"
echo "Build profile: debug"
else
echo "profile=release" >> "$GITHUB_OUTPUT"
echo "Build profile: release"
fi
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ contains(inputs.platform, 'macos') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
key: ${{ inputs.platform }}-${{ inputs.target }}
- name: install dependencies (ubuntu 24.04 x64)
if: contains(inputs.platform, 'ubuntu-24.04') && !contains(inputs.platform, 'arm')
run: |
sudo apt-get update
sudo apt-get install -y libappindicator3-dev librsvg2-dev patchelf libasound2-dev libopenblas-dev libx11-dev libxtst-dev libxrandr-dev libgtk-layer-shell0 libgtk-layer-shell-dev \
libwebkit2gtk-4.1-0=2.44.0-2 \
libwebkit2gtk-4.1-dev=2.44.0-2 \
libjavascriptcoregtk-4.1-0=2.44.0-2 \
libjavascriptcoregtk-4.1-dev=2.44.0-2 \
gir1.2-javascriptcoregtk-4.1=2.44.0-2 \
gir1.2-webkit2-4.1=2.44.0-2
- name: install dependencies (ubuntu 24.04 arm64)
if: contains(inputs.platform, 'ubuntu-24.04-arm')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev libopenblas-dev libx11-dev libxtst-dev libxrandr-dev libgtk-layer-shell0 libgtk-layer-shell-dev xdg-utils
- name: install dependencies (ubuntu 22.04)
if: contains(inputs.platform, 'ubuntu-22.04') && !contains(inputs.platform, 'arm')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev libopenblas-dev libx11-dev libxtst-dev libxrandr-dev libgtk-layer-shell0 libgtk-layer-shell-dev
- name: Verify gtk-layer-shell runtime dependency (Ubuntu)
if: contains(inputs.platform, 'ubuntu')
run: |
dpkg-query -W -f='${Status}\n' libgtk-layer-shell0 | grep -q "install ok installed"
ldconfig -p | grep -q "libgtk-layer-shell.so.0"
- name: Install Vulkan SDK (Windows x64)
if: contains(inputs.platform, 'windows') && !contains(inputs.target, 'aarch64')
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
# humbletim/install-vulkan-sdk@v1.2 cannot target Windows ARM64 yet.
# Download prebuilt binaries (Bin) + build headers/libs from source.
# See https://github.com/humbletim/install-vulkan-sdk/pull/22 for prebuilt ARM64 support progress.
- name: Prepare Vulkan SDK env (Windows ARM64)
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
shell: pwsh
run: |
$sdkDir = Join-Path $env:GITHUB_WORKSPACE "VULKAN_SDK"
New-Item -ItemType Directory -Force -Path $sdkDir | Out-Null
Add-Content -Path $env:GITHUB_ENV -Value "VULKAN_SDK=$sdkDir"
- name: Download Vulkan SDK binaries (Windows ARM64)
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
shell: pwsh
run: |
$url = "https://sdk.lunarg.com/sdk/download/1.4.309.0/warm/InstallVulkanARM64-1.4.309.0.exe"
$outFile = "vulkan_sdk_arm.exe"
Write-Host "Downloading Vulkan SDK binaries from $url"
Invoke-WebRequest -Uri $url -OutFile $outFile
- name: Extract Vulkan SDK binaries (Windows ARM64)
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
shell: pwsh
run: |
$sdkDir = $env:VULKAN_SDK
$sevenZip = (Get-Command 7z.exe -ErrorAction Stop).Source
Write-Host "Extracting binaries to $sdkDir"
& $sevenZip x "./vulkan_sdk_arm.exe" "-o$sdkDir" -aoa
$binPath = Join-Path $sdkDir "Bin"
Add-Content -Path $env:GITHUB_PATH -Value $binPath
Write-Host "Verifying glslc..."
& (Join-Path $binPath "glslc.exe") --version
- name: Build Vulkan SDK headers and libs (Windows ARM64)
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.4.309.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Cache trusted-signing-cli
if: contains(inputs.platform, 'windows') && inputs.sign-binaries
id: cache-tsc
uses: actions/cache@v4
with:
path: ~/.cargo/bin/trusted-signing-cli*
key: trusted-signing-cli-${{ env.TSC_VERSION }}-${{ runner.os }}-${{ runner.arch }}
- name: Install trusted-signing-cli
if: contains(inputs.platform, 'windows') && inputs.sign-binaries && steps.cache-tsc.outputs.cache-hit != 'true'
run: cargo install trusted-signing-cli@${{ env.TSC_VERSION }}
- name: Prepare Vulkan SDK for Ubuntu 24.04
if: contains(inputs.platform, 'ubuntu-24.04') && !contains(inputs.platform, 'arm')
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.290-noble.list https://packages.lunarg.com/vulkan/1.3.290/lunarg-vulkan-1.3.290-noble.list
sudo apt update
sudo apt install vulkan-sdk -y
sudo apt-get install -y mesa-vulkan-drivers
- name: Prepare Vulkan SDK for Ubuntu ARM64
if: contains(inputs.platform, 'ubuntu') && contains(inputs.platform, 'arm')
uses: jakoch/install-vulkan-sdk-action@v1
with:
vulkan_version: 1.4.335.0
cache: true
- name: Install Vulkan runtime libraries (Ubuntu ARM64)
if: contains(inputs.platform, 'ubuntu') && contains(inputs.platform, 'arm')
run: |
sudo apt-get update
sudo apt-get install -y libvulkan-dev mesa-vulkan-drivers
- name: Prepare Vulkan SDK for Ubuntu 22.04
if: contains(inputs.platform, 'ubuntu-22.04') && !contains(inputs.platform, 'arm')
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.290-jammy.list https://packages.lunarg.com/vulkan/1.3.290/lunarg-vulkan-1.3.290-jammy.list
sudo apt update
sudo apt install vulkan-sdk -y
sudo apt-get install -y mesa-vulkan-drivers
- name: install frontend dependencies
if: ${{ !(contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')) }}
run: bun install
- name: install frontend dependencies (Windows ARM64)
if: ${{ contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64') }}
run: bun install --cpu=arm64
- name: rustup install target
if: ${{ inputs.target != '' && !contains(inputs.target, 'x86_64-unknown-linux-gnu') && !contains(inputs.target, 'aarch64-unknown-linux-gnu') && !contains(inputs.target, 'x86_64-pc-windows-msvc') }}
run: rustup target add ${{ inputs.target }}
- name: import Apple Developer Certificate
if: contains(inputs.platform, 'macos') && inputs.sign-binaries
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security set-keychain-settings -t 3600 -u build.keychain
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
security find-identity -v -p codesigning build.keychain
- name: verify certificate
if: contains(inputs.platform, 'macos') && inputs.sign-binaries
run: |
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
echo "Certificate imported."
- name: Patch asset name pattern
id: patch-release-name
shell: bash
if: ${{ inputs.release-id != '' && inputs.asset-name-pattern != '' }}
run: |
platform="${{ inputs.platform }}"
replacement="$(echo ${platform} | sed -E 's/-latest//')"
patched_platform=$(echo '${{ inputs.asset-name-pattern }}' | sed -E "s/\[platform\]/${replacement}/")
if [[ -n "${{ inputs.asset-prefix }}" ]]; then
patched_platform="${{ inputs.asset-prefix }}_${patched_platform}"
fi
echo "platform=${patched_platform}" >> $GITHUB_OUTPUT
# whisper-rs-sys cmake builds create paths that exceed Windows MAX_PATH
# (260 chars). Shorten the target dir to keep paths under the limit.
- name: Shorten build path (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$drive = Split-Path -Qualifier $env:GITHUB_WORKSPACE
$targetDir = "$drive\t"
New-Item -ItemType Directory -Force -Path $targetDir | Out-Null
echo "CARGO_TARGET_DIR=$targetDir" >> $env:GITHUB_ENV
# ggml requires clang for ARM. The VS generator determines the compiler
# via the toolset (-T flag) which can't be overridden from env vars.
# Use Ninja + clang-cl instead, which respects CMAKE_C_COMPILER.
- name: Configure cmake for ARM64 (Windows)
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
shell: pwsh
run: |
echo "CMAKE_GENERATOR=Ninja" >> $env:GITHUB_ENV
echo "CMAKE_C_COMPILER=clang-cl" >> $env:GITHUB_ENV
echo "CMAKE_CXX_COMPILER=clang-cl" >> $env:GITHUB_ENV
echo "CMAKE_C_COMPILER_TARGET=aarch64-pc-windows-msvc" >> $env:GITHUB_ENV
echo "CMAKE_CXX_COMPILER_TARGET=aarch64-pc-windows-msvc" >> $env:GITHUB_ENV
echo "CL=/EHsc" >> $env:GITHUB_ENV
- name: Install ONNX Runtime (x86_64 macOS)
if: inputs.target == 'x86_64-apple-darwin'
shell: bash
run: |
ORT_VERSION="1.24.2"
curl -L -o ort.tgz "https://blob.handy.computer/onnxruntime-osx-x86_64-${ORT_VERSION}.tgz"
tar xzf ort.tgz
ORT_DIR="$(pwd)/onnxruntime-osx-x86_64-${ORT_VERSION}"
echo "ORT_LIB_LOCATION=$ORT_DIR/lib" >> $GITHUB_ENV
echo "ORT_PREFER_DYNAMIC_LINK=1" >> $GITHUB_ENV
# Bundle the versioned dylib (matches the install name @rpath/libonnxruntime.1.24.2.dylib)
jq --arg lib "$ORT_DIR/lib/libonnxruntime.${ORT_VERSION}.dylib" \
'.bundle.macOS.frameworks = [$lib]' \
src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
- name: Install ONNX Runtime (x86_64 Linux, Ubuntu 22.04)
if: contains(inputs.platform, 'ubuntu-22.04') && inputs.target == 'x86_64-unknown-linux-gnu'
shell: bash
run: |
ORT_VERSION="1.24.2"
curl -L -o ort.tgz "https://blob.handy.computer/onnxruntime-linux-x86_64-${ORT_VERSION}.tgz"
tar xzf ort.tgz
ORT_DIR="$(pwd)/onnxruntime-linux-x86_64-${ORT_VERSION}"
echo "ORT_LIB_LOCATION=$ORT_DIR/lib" >> $GITHUB_ENV
echo "ORT_PREFER_DYNAMIC_LINK=1" >> $GITHUB_ENV
# Resolve symlinks so the deb bundler gets real files (not broken symlinks)
for f in "$ORT_DIR"/lib/libonnxruntime.so*; do
if [ -L "$f" ]; then
cp -L "$f" "$f.real" && mv "$f.real" "$f"
fi
done
# Add the shared libs to the deb package under /usr/lib
# deb.files key = destination in package, value = source on disk
jq --arg so "$ORT_DIR/lib/libonnxruntime.so" \
--arg so1 "$ORT_DIR/lib/libonnxruntime.so.1" \
--arg sov "$ORT_DIR/lib/libonnxruntime.so.1.24.2" \
'.bundle.linux.deb.files["/usr/lib/libonnxruntime.so"] = $so | .bundle.linux.deb.files["/usr/lib/libonnxruntime.so.1"] = $so1 | .bundle.linux.deb.files["/usr/lib/libonnxruntime.so.1.24.2"] = $sov' \
src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
- name: Build with Tauri
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_ID: ${{ inputs.sign-binaries && secrets.APPLE_ID || '' }}
APPLE_ID_PASSWORD: ${{ inputs.sign-binaries && secrets.APPLE_ID_PASSWORD || '' }}
APPLE_PASSWORD: ${{ inputs.sign-binaries && secrets.APPLE_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ inputs.sign-binaries && secrets.APPLE_TEAM_ID || '' }}
APPLE_CERTIFICATE: ${{ inputs.sign-binaries && secrets.APPLE_CERTIFICATE || '' }}
APPLE_CERTIFICATE_PASSWORD: ${{ inputs.sign-binaries && secrets.APPLE_CERTIFICATE_PASSWORD || '' }}
APPLE_SIGNING_IDENTITY: ${{ inputs.sign-binaries && env.CERT_ID || '' }}
AZURE_CLIENT_ID: ${{ inputs.sign-binaries && secrets.AZURE_CLIENT_ID || '' }}
AZURE_CLIENT_SECRET: ${{ inputs.sign-binaries && secrets.AZURE_CLIENT_SECRET || '' }}
AZURE_TENANT_ID: ${{ inputs.sign-binaries && secrets.AZURE_TENANT_ID || '' }}
TAURI_SIGNING_PRIVATE_KEY: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || '' }}
WHISPER_NO_AVX: ${{ contains(inputs.platform, 'ubuntu') && !contains(inputs.platform, 'arm') && 'ON' || '' }}
WHISPER_NO_AVX2: ${{ contains(inputs.platform, 'ubuntu') && !contains(inputs.platform, 'arm') && 'ON' || '' }}
with:
tagName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }}
releaseName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }}
releaseId: ${{ inputs.release-id }}
assetNamePattern: ${{ steps.patch-release-name.outputs.platform }}
args: ${{ inputs.build-args }}
- name: Verify macOS dylib bundling
if: inputs.target == 'x86_64-apple-darwin'
shell: bash
run: |
APP=$(find src-tauri/target -name "*.app" -type d | head -1)
echo "=== Frameworks contents ==="
ls -la "$APP/Contents/Frameworks/" | grep onnx || true
echo "=== Binary linked libs ==="
otool -L "$APP/Contents/MacOS/handy" | grep onnx || true
echo "=== Checking all @rpath deps are satisfied ==="
# Extract every @rpath lib the binary needs
otool -L "$APP/Contents/MacOS/handy" | grep '@rpath/' | awk '{print $1}' | while read dep; do
libname=$(basename "$dep")
if [ ! -f "$APP/Contents/Frameworks/$libname" ]; then
echo "MISSING: $libname not found in Frameworks/"
exit 1
else
echo "OK: $libname"
fi
done
- name: Upload artifacts (macOS)
if: inputs.upload-artifacts && contains(inputs.platform, 'macos')
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.asset-prefix }}-${{ inputs.target }}
path: |
src-tauri/target/${{ inputs.target }}/${{ steps.build-profile.outputs.profile }}/bundle/dmg/*.dmg
src-tauri/target/${{ inputs.target }}/${{ steps.build-profile.outputs.profile }}/bundle/macos/*.app
retention-days: 30
- name: Install FUSE for AppImage processing
if: contains(inputs.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y fuse libfuse2
- name: Remove libwayland-client.so from AppImage
if: contains(inputs.platform, 'ubuntu')
run: |
# Find the AppImage file
APPIMAGE_PATH=$(find src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/appimage -name "*.AppImage" | head -1)
if [ -n "$APPIMAGE_PATH" ]; then
echo "Processing AppImage: $APPIMAGE_PATH"
# Make AppImage executable
chmod +x "$APPIMAGE_PATH"
# Extract AppImage
cd "$(dirname "$APPIMAGE_PATH")"
APPIMAGE_NAME=$(basename "$APPIMAGE_PATH")
# Extract using the AppImage itself
"./$APPIMAGE_NAME" --appimage-extract
# Remove libwayland-client.so files
echo "Removing libwayland-client.so files..."
find squashfs-root -name "libwayland-client.so*" -type f -delete
# List what was removed for verification
echo "Files remaining in lib directories:"
find squashfs-root -name "lib*" -type d | head -5 | while read dir; do
echo "Contents of $dir:"
ls "$dir" | grep -E "(wayland|fuse)" || echo " No wayland/fuse libraries found"
done
# Detect architecture and get appropriate appimagetool
if [[ "$(uname -m)" == "aarch64" ]]; then
APPIMAGETOOL_ARCH="aarch64"
else
APPIMAGETOOL_ARCH="x86_64"
fi
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${APPIMAGETOOL_ARCH}.AppImage"
chmod +x "appimagetool-${APPIMAGETOOL_ARCH}.AppImage"
# Repackage AppImage with no-appstream to avoid warnings
ARCH="${APPIMAGETOOL_ARCH}" "./appimagetool-${APPIMAGETOOL_ARCH}.AppImage" --no-appstream squashfs-root "$APPIMAGE_NAME"
# Clean up
rm -rf squashfs-root "appimagetool-${APPIMAGETOOL_ARCH}.AppImage"
echo "libwayland-client.so removed from AppImage successfully"
else
echo "No AppImage found to process"
fi
- name: Upload artifacts (Linux)
if: inputs.upload-artifacts && contains(inputs.platform, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.asset-prefix }}-${{ inputs.platform }}-${{ inputs.target }}
path: |
src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/deb/*.deb
src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/appimage/*.AppImage
src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/rpm/*.rpm
retention-days: 30
- name: Resolve Windows artifact path
if: inputs.upload-artifacts && contains(inputs.platform, 'windows')
id: win-artifact-path
shell: pwsh
run: |
$base = if ($env:CARGO_TARGET_DIR) { $env:CARGO_TARGET_DIR } else { "src-tauri/target" }
echo "base=$base" >> $env:GITHUB_OUTPUT
- name: Upload artifacts (Windows)
if: inputs.upload-artifacts && contains(inputs.platform, 'windows')
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.asset-prefix }}-${{ inputs.target }}
path: |
${{ steps.win-artifact-path.outputs.base }}/${{ inputs.target != '' && inputs.target != 'x86_64-pc-windows-msvc' && format('{0}/{1}', inputs.target, steps.build-profile.outputs.profile) || steps.build-profile.outputs.profile }}/bundle/msi/*.msi
${{ steps.win-artifact-path.outputs.base }}/${{ inputs.target != '' && inputs.target != 'x86_64-pc-windows-msvc' && format('{0}/{1}', inputs.target, steps.build-profile.outputs.profile) || steps.build-profile.outputs.profile }}/bundle/nsis/*.exe
retention-days: 30