681 lines
28 KiB
YAML
681 lines
28 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: "meetily"
|
|
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
|
|
|
|
jobs:
|
|
build:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ${{ inputs.platform }}
|
|
steps:
|
|
- 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": "[^"]*"' frontend/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 pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
# Only aarch64-apple-darwin for Apple Silicon (no Intel support)
|
|
targets: ${{ contains(inputs.platform, 'macos') && 'aarch64-apple-darwin' || '' }}
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: ". -> target"
|
|
key: ${{ inputs.platform }}-${{ inputs.target }}-vulkan-v2
|
|
|
|
- name: install dependencies (ubuntu 24.04)
|
|
if: contains(inputs.platform, 'ubuntu-24.04')
|
|
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 \
|
|
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 22.04)
|
|
if: contains(inputs.platform, 'ubuntu-22.04')
|
|
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
|
|
|
|
- name: Install Vulkan SDK (Windows)
|
|
if: contains(inputs.platform, 'windows')
|
|
uses: humbletim/install-vulkan-sdk@v1.2
|
|
with:
|
|
version: 1.4.309.0
|
|
cache: true
|
|
|
|
- name: Verify and Configure Vulkan SDK (Windows)
|
|
if: contains(inputs.platform, 'windows')
|
|
shell: pwsh
|
|
run: |
|
|
Write-Host "=== Vulkan SDK Configuration ==="
|
|
|
|
$vulkanSdk = $env:VULKAN_SDK
|
|
Write-Host "VULKAN_SDK: $vulkanSdk"
|
|
|
|
if (-not $vulkanSdk -or -not (Test-Path $vulkanSdk)) {
|
|
Write-Error "VULKAN_SDK not set or path does not exist"
|
|
exit 1
|
|
}
|
|
|
|
# Verify critical directories exist
|
|
$binDir = Join-Path $vulkanSdk "Bin"
|
|
$libDir = Join-Path $vulkanSdk "Lib"
|
|
$includeDir = Join-Path $vulkanSdk "Include"
|
|
|
|
Write-Host "Directory structure:"
|
|
Write-Host " Bin: $(if (Test-Path $binDir) { 'EXISTS' } else { 'MISSING' })"
|
|
Write-Host " Lib: $(if (Test-Path $libDir) { 'EXISTS' } else { 'MISSING' })"
|
|
Write-Host " Include: $(if (Test-Path $includeDir) { 'EXISTS' } else { 'MISSING' })"
|
|
|
|
# Check for glslc and glslangValidator
|
|
$glslc = Join-Path $binDir "glslc.exe"
|
|
$glslangValidator = Join-Path $binDir "glslangValidator.exe"
|
|
|
|
Write-Host "Shader compilers:"
|
|
Write-Host " glslc: $(if (Test-Path $glslc) { 'FOUND' } else { 'MISSING' })"
|
|
Write-Host " glslangValidator: $(if (Test-Path $glslangValidator) { 'FOUND' } else { 'MISSING' })"
|
|
|
|
# Ensure Bin is in PATH for shader compilers
|
|
$currentPath = $env:PATH
|
|
if (-not $currentPath.Contains($binDir)) {
|
|
Write-Host "Adding Vulkan SDK Bin to PATH..."
|
|
"PATH=$binDir;$currentPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
}
|
|
|
|
# Set additional environment variables for CMake
|
|
Write-Host "Setting CMake-related environment variables..."
|
|
"Vulkan_LIBRARY=$libDir\vulkan-1.lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
"Vulkan_INCLUDE_DIR=$includeDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
"VK_SDK_PATH=$vulkanSdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
Write-Host "=== Vulkan SDK Configuration Complete ==="
|
|
|
|
- name: Copy Vulkan runtime for bundling (Windows)
|
|
if: contains(inputs.platform, 'windows')
|
|
shell: pwsh
|
|
run: |
|
|
# Create runtime directory
|
|
$runtimeDir = "frontend/src-tauri/vulkan-runtime"
|
|
if (!(Test-Path $runtimeDir)) {
|
|
New-Item -ItemType Directory -Force -Path $runtimeDir | Out-Null
|
|
}
|
|
|
|
# Find Vulkan SDK - check multiple possible locations
|
|
$vulkanSdk = $env:VULKAN_SDK
|
|
Write-Host "VULKAN_SDK env: $vulkanSdk"
|
|
|
|
# Common installation paths
|
|
$possiblePaths = @(
|
|
"$vulkanSdk\Bin\vulkan-1.dll",
|
|
"$vulkanSdk\runtime\x64\vulkan-1.dll",
|
|
"C:\VulkanSDK\1.4.309.0\Bin\vulkan-1.dll",
|
|
"C:\VulkanSDK\1.4.309.0\runtime\x64\vulkan-1.dll",
|
|
"$env:ProgramFiles\VulkanSDK\Bin\vulkan-1.dll",
|
|
"$env:SystemRoot\System32\vulkan-1.dll"
|
|
)
|
|
|
|
$vulkanDll = $null
|
|
foreach ($path in $possiblePaths) {
|
|
Write-Host "Checking: $path"
|
|
if (Test-Path $path) {
|
|
$vulkanDll = $path
|
|
Write-Host "Found vulkan-1.dll at: $path"
|
|
break
|
|
}
|
|
}
|
|
|
|
if ($vulkanDll) {
|
|
Copy-Item $vulkanDll -Destination $runtimeDir
|
|
Write-Host "Copied vulkan-1.dll to $runtimeDir"
|
|
} else {
|
|
Write-Host "Searching for vulkan-1.dll on system..."
|
|
$found = Get-ChildItem -Path "C:\" -Filter "vulkan-1.dll" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
if ($found) {
|
|
Write-Host "Found at: $($found.FullName)"
|
|
Copy-Item $found.FullName -Destination $runtimeDir
|
|
} else {
|
|
Write-Warning "vulkan-1.dll not found - Vulkan apps may not work without it"
|
|
Write-Host "System will use the user's installed Vulkan runtime"
|
|
}
|
|
}
|
|
|
|
# Verify
|
|
Write-Host "Contents of vulkan-runtime directory:"
|
|
Get-ChildItem $runtimeDir -ErrorAction SilentlyContinue
|
|
|
|
- name: Setup DigiCert Environment
|
|
if: contains(inputs.platform, 'windows') && inputs.sign-binaries
|
|
shell: pwsh
|
|
run: |
|
|
# Set environment variables
|
|
"SM_HOST=${{ secrets.SM_HOST }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
"SM_API_KEY=${{ secrets.SM_API_KEY }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
"SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
"SM_CODE_SIGNING_CERT_SHA1_HASH=${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
# Decode and save client certificate using PowerShell
|
|
$certPath = "D:\Certificate_pkcs12.p12"
|
|
$base64String = "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
|
|
$certBytes = [System.Convert]::FromBase64String($base64String)
|
|
[System.IO.File]::WriteAllBytes($certPath, $certBytes)
|
|
|
|
# Verify the certificate file was created and has content
|
|
if (Test-Path $certPath) {
|
|
$certFile = Get-Item $certPath
|
|
Write-Host "Certificate file created: $certPath"
|
|
Write-Host " Size: $($certFile.Length) bytes"
|
|
Write-Host " Last Modified: $($certFile.LastWriteTime)"
|
|
|
|
# Verify it's a valid PKCS12 file by checking if we can load it
|
|
try {
|
|
$testCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath, "${{ secrets.SM_CLIENT_CERT_PASSWORD }}")
|
|
Write-Host " ✓ Certificate file is valid PKCS12 format"
|
|
Write-Host " ✓ Password is correct"
|
|
Write-Host " Certificate Subject: $($testCert.Subject)"
|
|
Write-Host " Certificate Thumbprint: $($testCert.Thumbprint)"
|
|
} catch {
|
|
Write-Warning "⚠ Certificate validation failed"
|
|
Write-Warning "Error: $($_.Exception.Message)"
|
|
Write-Warning "This may cause issues with signing, but we'll continue..."
|
|
}
|
|
} else {
|
|
Write-Error "Certificate file was not created at $certPath"
|
|
exit 1
|
|
}
|
|
|
|
# Set the environment variable with Windows-style path
|
|
"SM_CLIENT_CERT_FILE=D:\Certificate_pkcs12.p12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
- name: Setup DigiCert KeyLocker
|
|
if: contains(inputs.platform, 'windows') && inputs.sign-binaries
|
|
uses: digicert/ssm-code-signing@v1.1.1
|
|
|
|
- name: Sync Certificate to Windows Certificate Store
|
|
if: contains(inputs.platform, 'windows') && inputs.sign-binaries
|
|
shell: pwsh
|
|
run: |
|
|
Write-Host "============================================================"
|
|
Write-Host "=== SYNCING CERTIFICATE TO WINDOWS CERTIFICATE STORE ==="
|
|
Write-Host "============================================================"
|
|
Write-Host "This step syncs the DigiCert certificate from KeyLocker HSM"
|
|
Write-Host "to the Windows Certificate Store (required for signing)"
|
|
Write-Host ""
|
|
|
|
# First, get the keypair alias from smctl keypair ls
|
|
Write-Host "Retrieving keypair alias from DigiCert KeyLocker..."
|
|
$keypairOutput = smctl keypair ls 2>&1 | Out-String
|
|
Write-Host $keypairOutput
|
|
|
|
# Extract the alias (looking for pattern like "key_XXXXXXXXXX")
|
|
$aliasMatch = [regex]::Match($keypairOutput, 'key_\d+')
|
|
if ($aliasMatch.Success) {
|
|
$keypairAlias = $aliasMatch.Value
|
|
Write-Host "✓ Found keypair alias: $keypairAlias"
|
|
} else {
|
|
Write-Error "✗ Could not find keypair alias in smctl output"
|
|
Write-Error "Output was: $keypairOutput"
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "Syncing certificate using alias: $keypairAlias"
|
|
$certsyncOutput = smctl windows certsync --keypair-alias $keypairAlias 2>&1
|
|
Write-Host $certsyncOutput
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host ""
|
|
Write-Error "✗ Certificate sync FAILED"
|
|
Write-Error "Exit code: $LASTEXITCODE"
|
|
Write-Error "Output: $certsyncOutput"
|
|
Write-Error ""
|
|
Write-Error "Possible causes:"
|
|
Write-Error " 1. Keypair alias '$keypairAlias' not found in KeyLocker"
|
|
Write-Error " 2. Certificate is revoked or expired"
|
|
Write-Error " 3. API credentials are invalid"
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "✓ Certificate synced successfully"
|
|
Write-Host ""
|
|
|
|
# Verify certificate is now in Windows store
|
|
Write-Host "Verifying certificate in Windows Certificate Store..."
|
|
$cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq $env:SM_CODE_SIGNING_CERT_SHA1_HASH } | Select-Object -First 1
|
|
|
|
if (-not $cert) {
|
|
# Try LocalMachine store
|
|
$cert = Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object { $_.Thumbprint -eq $env:SM_CODE_SIGNING_CERT_SHA1_HASH } | Select-Object -First 1
|
|
}
|
|
|
|
if ($cert) {
|
|
Write-Host "✓ Certificate found in Windows Certificate Store"
|
|
Write-Host " Subject: $($cert.Subject)"
|
|
Write-Host " Issuer: $($cert.Issuer)"
|
|
Write-Host " Thumbprint: $($cert.Thumbprint)"
|
|
Write-Host " Valid From: $($cert.NotBefore)"
|
|
Write-Host " Valid Until: $($cert.NotAfter)"
|
|
} else {
|
|
Write-Warning "Certificate not found in Windows Certificate Store after sync"
|
|
Write-Warning "Signing may fail. Continuing anyway..."
|
|
}
|
|
|
|
# Export keypair alias for Tauri signCommand
|
|
Write-Host ""
|
|
Write-Host "Exporting DIGICERT_KEYPAIR_ALIAS for Tauri signCommand..."
|
|
"DIGICERT_KEYPAIR_ALIAS=$keypairAlias" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
Write-Host "✓ DIGICERT_KEYPAIR_ALIAS=$keypairAlias"
|
|
|
|
Write-Host ""
|
|
Write-Host "============================================================"
|
|
Write-Host ""
|
|
|
|
- name: Verify DigiCert Setup
|
|
if: contains(inputs.platform, 'windows') && inputs.sign-binaries
|
|
shell: pwsh
|
|
run: |
|
|
Write-Host "=== DigiCert Setup Verification ==="
|
|
Write-Host ""
|
|
|
|
# Verify SMCTL is available
|
|
Write-Host "SMCTL Version:"
|
|
smctl --version
|
|
Write-Host ""
|
|
|
|
# Check environment variables
|
|
Write-Host "Environment Variables:"
|
|
Write-Host " SM_HOST: $env:SM_HOST"
|
|
Write-Host " SM_API_KEY: $($env:SM_API_KEY.Substring(0, [Math]::Min(20, $env:SM_API_KEY.Length)))..."
|
|
Write-Host " SM_CLIENT_CERT_FILE: $env:SM_CLIENT_CERT_FILE"
|
|
Write-Host " SM_CLIENT_CERT_PASSWORD: $(if ($env:SM_CLIENT_CERT_PASSWORD) { '***SET***' } else { 'NOT SET' })"
|
|
Write-Host ""
|
|
|
|
# Verify client certificate file exists and check size
|
|
if (Test-Path $env:SM_CLIENT_CERT_FILE) {
|
|
$certFile = Get-Item $env:SM_CLIENT_CERT_FILE
|
|
Write-Host "Client Certificate File:"
|
|
Write-Host " Path: $($certFile.FullName)"
|
|
Write-Host " Size: $($certFile.Length) bytes"
|
|
Write-Host " Last Modified: $($certFile.LastWriteTime)"
|
|
} else {
|
|
Write-Error "Client certificate file NOT FOUND: $env:SM_CLIENT_CERT_FILE"
|
|
}
|
|
Write-Host ""
|
|
|
|
# List available keypairs (verifies API authentication works)
|
|
Write-Host "Available Keypairs:"
|
|
smctl keypair ls
|
|
Write-Host ""
|
|
|
|
# Verify certificate (healthcheck)
|
|
Write-Host "DigiCert Healthcheck:"
|
|
smctl healthcheck
|
|
Write-Host ""
|
|
|
|
# Note: Healthcheck may show cert path/password warning but if keypair ls works,
|
|
# the signing should still work. We'll test in the pre-build signing test.
|
|
|
|
- name: Prepare Vulkan SDK for Ubuntu 24.04
|
|
if: contains(inputs.platform, 'ubuntu-24.04')
|
|
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 22.04
|
|
if: contains(inputs.platform, 'ubuntu-22.04')
|
|
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
|
|
run: |
|
|
cd frontend
|
|
pnpm install
|
|
|
|
- name: rustup install target
|
|
if: ${{ inputs.target != '' && !contains(inputs.target, 'unknown-linux-gnu') && !contains(inputs.target, '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: $CERT_ID"
|
|
|
|
- name: Configure build acceleration
|
|
if: contains(inputs.platform, 'macos')
|
|
run: |
|
|
echo "✓ macOS build will use Metal GPU acceleration (enabled by default)"
|
|
echo "✓ CoreML acceleration available for Apple Silicon"
|
|
|
|
- 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
|
|
|
|
- name: Determine build features
|
|
id: build-features
|
|
shell: bash
|
|
run: |
|
|
FEATURES=""
|
|
|
|
# Windows: Use Vulkan for GPU acceleration
|
|
if [[ "${{ inputs.platform }}" == *"windows"* ]]; then
|
|
FEATURES="--features vulkan"
|
|
echo "Windows build with Vulkan GPU acceleration"
|
|
fi
|
|
|
|
# Linux: Use OpenBLAS for optimized CPU performance
|
|
if [[ "${{ inputs.platform }}" == *"ubuntu"* ]]; then
|
|
FEATURES="--features openblas"
|
|
echo "Linux build with OpenBLAS CPU optimization"
|
|
fi
|
|
|
|
# macOS: Uses Metal by default, no additional features needed
|
|
if [[ "${{ inputs.platform }}" == *"macos"* ]]; then
|
|
echo "macOS build with Metal GPU acceleration (default)"
|
|
fi
|
|
|
|
echo "features=$FEATURES" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build llama-helper sidecar (Windows)
|
|
if: contains(inputs.platform, 'windows')
|
|
shell: pwsh
|
|
run: |
|
|
# Build llama-helper without GPU features (CPU-only)
|
|
# Note: Vulkan build has CMake race condition issues with llama-cpp-sys-2
|
|
# The Tauri app itself uses whisper-rs with Vulkan for transcription
|
|
# llama-helper is for LLM inference and works fine on CPU
|
|
Write-Host "Building llama-helper sidecar (CPU-only)..."
|
|
|
|
cargo build --release -p llama-helper
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error "Failed to build llama-helper"
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
# Copy binary to binaries directory
|
|
New-Item -ItemType Directory -Force -Path "frontend/src-tauri/binaries" | Out-Null
|
|
Copy-Item "target/release/llama-helper.exe" -Destination "frontend/src-tauri/binaries/llama-helper-x86_64-pc-windows-msvc.exe"
|
|
|
|
Write-Host "Copied llama-helper to frontend/src-tauri/binaries/"
|
|
Get-ChildItem "frontend/src-tauri/binaries/"
|
|
|
|
- name: Build llama-helper sidecar (macOS/Linux)
|
|
if: "!contains(inputs.platform, 'windows')"
|
|
shell: bash
|
|
run: |
|
|
echo "Building llama-helper sidecar..."
|
|
|
|
# Determine llama-helper features based on platform
|
|
LLAMA_FEATURES=""
|
|
if [[ "${{ inputs.platform }}" == *"macos"* ]]; then
|
|
LLAMA_FEATURES="--features metal"
|
|
echo "Using Metal GPU acceleration for macOS"
|
|
else
|
|
echo "Using CPU-only mode for Linux"
|
|
fi
|
|
|
|
# Build llama-helper from workspace root
|
|
cargo build --release -p llama-helper $LLAMA_FEATURES
|
|
|
|
# Determine target triple and binary extension
|
|
TARGET="${{ inputs.target }}"
|
|
if [[ -z "$TARGET" ]]; then
|
|
TARGET=$(rustc -vV | grep "host:" | awk '{print $2}')
|
|
fi
|
|
|
|
# Copy binary to binaries directory
|
|
mkdir -p frontend/src-tauri/binaries
|
|
cp target/release/llama-helper frontend/src-tauri/binaries/llama-helper-${TARGET}
|
|
|
|
echo "Copied llama-helper to frontend/src-tauri/binaries/llama-helper-${TARGET}"
|
|
ls -la frontend/src-tauri/binaries/
|
|
|
|
- name: Cache FFmpeg binary
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: frontend/src-tauri/binaries/ffmpeg-*
|
|
key: ${{ runner.os }}-ffmpeg-${{ hashFiles('frontend/src-tauri/build.rs', 'frontend/src-tauri/build/ffmpeg.rs') }}
|
|
|
|
- name: Build with Tauri
|
|
id: tauri-build
|
|
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 || '' }}
|
|
# Tauri updater signing (ALWAYS enabled for .sig files)
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
# License validation RSA public key (embedded at build time)
|
|
MEETILY_RSA_PUBLIC_KEY: ${{ secrets.MEETILY_RSA_PUBLIC_KEY }}
|
|
# Supabase configuration (for online license verification)
|
|
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
|
|
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
|
|
with:
|
|
projectPath: frontend
|
|
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 }}
|
|
args: ${{ inputs.build-args }} ${{ steps.build-features.outputs.features }}
|
|
|
|
- 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: |
|
|
target/${{ inputs.target }}/${{ steps.build-profile.outputs.profile }}/bundle/dmg/*.dmg
|
|
target/${{ inputs.target }}/${{ steps.build-profile.outputs.profile }}/bundle/macos/*.app
|
|
target/${{ inputs.target }}/${{ steps.build-profile.outputs.profile }}/bundle/macos/*.app.tar.gz
|
|
target/${{ inputs.target }}/${{ steps.build-profile.outputs.profile }}/bundle/macos/*.app.tar.gz.sig
|
|
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 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
|
|
|
|
# Get appimagetool
|
|
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
chmod +x appimagetool-x86_64.AppImage
|
|
|
|
# Repackage AppImage with no-appstream to avoid warnings
|
|
ARCH=x86_64 ./appimagetool-x86_64.AppImage --no-appstream squashfs-root "$APPIMAGE_NAME"
|
|
|
|
# Clean up
|
|
rm -rf squashfs-root appimagetool-x86_64.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: |
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/deb/*.deb
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/appimage/*.AppImage
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/rpm/*.rpm
|
|
retention-days: 30
|
|
|
|
- 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: |
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/msi/*.msi
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/msi/*.msi.sig
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/nsis/*.exe
|
|
target/${{ steps.build-profile.outputs.profile }}/bundle/nsis/*.exe.sig
|
|
retention-days: 30
|