Skip to content

feat(atlascloud): support workspace agent provider (#584) #1106

feat(atlascloud): support workspace agent provider (#584)

feat(atlascloud): support workspace agent provider (#584) #1106

Workflow file for this run

name: 'Tauri Build'
on:
workflow_call:
inputs:
version:
description: "Semver version to build, ex: 0.2.4"
required: true
type: string
pull_request:
paths:
- 'apps/desktop/**'
- 'src/**'
- 'package.json'
- 'next.config.ts'
- 'scripts/build/build-static.mjs'
- 'scripts/prepare-frontend.mjs'
push:
branches:
- main
paths:
- 'apps/desktop/**'
- 'src/**'
- 'package.json'
- 'package-lock.json'
- '.npmrc'
- 'next.config.ts'
- 'scripts/build/build-static.mjs'
- 'scripts/prepare-frontend.mjs'
workflow_dispatch:
inputs:
version:
description: "Semver version to build, ex: 0.2.4"
required: false
type: string
jobs:
build-tauri:
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
arch: 'arm64'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
arch: 'x64'
- platform: 'ubuntu-22.04'
args: ''
arch: 'x64'
- platform: 'windows-latest'
args: ''
arch: 'x64'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6
- name: Sync release version
if: ${{ inputs.version || github.event.inputs.version }}
shell: bash
env:
RELEASE_VERSION: ${{ inputs.version || github.event.inputs.version }}
run: node scripts/release/sync-release-version.mjs --version "${RELEASE_VERSION}"
- name: Verify synced release files
if: ${{ inputs.version || github.event.inputs.version }}
shell: bash
run: |
# Use while read loop instead of mapfile for Bash 3 compatibility
changed_files=()
while IFS= read -r line; do
changed_files+=("$line")
done < <(git diff --name-only)
if [[ ${#changed_files[@]} -eq 0 ]]; then
echo "Release version already aligned"
exit 0
fi
allowed_files=(
"Cargo.toml"
"package.json"
"apps/desktop/package.json"
"apps/desktop/src-tauri/Cargo.toml"
"apps/desktop/src-tauri/tauri.conf.json"
"packages/routa-cli/package.json"
"packages/harness-monitor/package.json"
"crates/harness-monitor/Cargo.toml"
)
for file in "${changed_files[@]}"; do
case " ${allowed_files[*]} " in
*" ${file} "*) ;;
*)
echo "Unexpected file changed during release version sync: ${file}" >&2
exit 1
;;
esac
done
- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libglib2.0-dev \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libsoup-3.0-dev \
libjavascriptcoregtk-4.1-dev \
patchelf \
libclang-dev \
cmake \
build-essential
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './apps/desktop/src-tauri -> target'
- name: Install root dependencies
run: npm ci
- name: Verify desktop workspace toolchain
run: npm exec --workspace apps/desktop -- tauri --version
- name: Verify root frontend toolchain
run: npm exec --no -- next --version
- name: Create placeholder frontend directory (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p apps/desktop/src-tauri/frontend
echo "Placeholder for Tauri build" > apps/desktop/src-tauri/frontend/.placeholder
- name: Create placeholder frontend directory (Windows)
if: runner.os == 'Windows'
run: |
New-Item -ItemType Directory -Force -Path apps/desktop/src-tauri/frontend
echo "Placeholder for Tauri build" > apps/desktop/src-tauri/frontend/.placeholder
- name: Prepare frontend for Tauri bundling
run: node scripts/prepare-frontend.mjs
- name: Set default Tauri build args
shell: bash
run: echo "TAURI_BUILD_ARGS=${{ matrix.args }}" >> "$GITHUB_ENV"
- name: Use NSIS-only bundling for Windows prerelease
if: ${{ matrix.platform == 'windows-latest' }}
shell: bash
env:
RELEASE_VERSION: ${{ inputs.version || github.event.inputs.version }}
run: |
if [[ -n "$RELEASE_VERSION" && "$RELEASE_VERSION" == *-* ]]; then
build_args="${TAURI_BUILD_ARGS:+${TAURI_BUILD_ARGS} }--bundles nsis"
echo "Using NSIS-only bundling for Windows prerelease version ${RELEASE_VERSION}"
echo "TAURI_BUILD_ARGS=$build_args" >> "$GITHUB_ENV"
fi
- name: Clean previous Tauri bundle outputs
shell: bash
run: |
for root in target apps/desktop/src-tauri/target; do
if [[ ! -d "$root" ]]; then
continue
fi
while IFS= read -r bundle_dir; do
rm -rf "$bundle_dir"
done < <(find "$root" -type d -path '*/release/bundle' -prune -print)
done
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: apps/desktop
args: ${{ env.TAURI_BUILD_ARGS }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: tauri-build-${{ inputs.version || github.event.inputs.version || 'snapshot' }}-${{ matrix.platform }}-${{ matrix.arch }}
path: |
target/**/release/bundle/**/*.dmg
target/**/release/bundle/**/*.app
target/**/release/bundle/**/*.deb
target/**/release/bundle/**/*.AppImage
target/**/release/bundle/**/*.msi
target/**/release/bundle/**/*.exe
apps/desktop/src-tauri/target/release/bundle/**/*.dmg
apps/desktop/src-tauri/target/release/bundle/**/*.app
apps/desktop/src-tauri/target/release/bundle/**/*.deb
apps/desktop/src-tauri/target/release/bundle/**/*.AppImage
apps/desktop/src-tauri/target/release/bundle/**/*.msi
apps/desktop/src-tauri/target/release/bundle/**/*.exe
apps/desktop/src-tauri/target/**/release/bundle/**/*.dmg
apps/desktop/src-tauri/target/**/release/bundle/**/*.app
apps/desktop/src-tauri/target/**/release/bundle/**/*.deb
apps/desktop/src-tauri/target/**/release/bundle/**/*.AppImage
apps/desktop/src-tauri/target/**/release/bundle/**/*.msi
apps/desktop/src-tauri/target/**/release/bundle/**/*.exe
retention-days: 7