mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 19:02:16 +00:00
The tauri action attempts certificate import when APPLE_CERTIFICATE is present in the environment (even as empty string). Move Apple signing env vars to a conditional step that only writes to GITHUB_ENV when the secret is actually non-empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
176 lines
5.0 KiB
YAML
176 lines
5.0 KiB
YAML
name: Desktop Build & Release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'desktop/**'
|
|
- '.github/workflows/desktop.yml'
|
|
tags:
|
|
- 'desktop-v*'
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'desktop/**'
|
|
- '.github/workflows/desktop.yml'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: desktop-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libgtk-3-dev \
|
|
libappindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
libxdo-dev
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install frontend dependencies
|
|
working-directory: desktop
|
|
run: npm install
|
|
|
|
- name: TypeScript type-check
|
|
working-directory: desktop
|
|
run: npx tsc --noEmit
|
|
|
|
- name: Vite build
|
|
working-directory: desktop
|
|
run: npx vite build
|
|
|
|
- name: Install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: 'desktop/src-tauri -> target'
|
|
|
|
- name: Cargo check
|
|
working-directory: desktop/src-tauri
|
|
run: cargo check
|
|
|
|
build-and-release:
|
|
needs: [validate]
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: ubuntu-22.04
|
|
args: ''
|
|
- platform: macos-latest
|
|
args: '--target aarch64-apple-darwin'
|
|
- platform: windows-latest
|
|
args: ''
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install system dependencies (Linux)
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libgtk-3-dev \
|
|
libappindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
libxdo-dev
|
|
|
|
- name: Install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin' || '' }}
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: 'desktop/src-tauri -> target'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install frontend dependencies
|
|
working-directory: desktop
|
|
run: npm install
|
|
|
|
- name: Determine release info
|
|
id: release-info
|
|
shell: bash
|
|
run: |
|
|
if [[ "${{ github.ref }}" == refs/tags/desktop-v* ]]; then
|
|
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
|
|
echo "name=Desktop ${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
|
|
echo "prerelease=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "tag=desktop-latest" >> "$GITHUB_OUTPUT"
|
|
echo "name=Desktop (Latest Build)" >> "$GITHUB_OUTPUT"
|
|
echo "prerelease=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Configure Apple signing
|
|
if: runner.os == 'macOS'
|
|
env:
|
|
CERT: ${{ secrets.APPLE_CERTIFICATE }}
|
|
CERT_PASS: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
SIGN_ID: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
|
A_ID: ${{ secrets.APPLE_ID }}
|
|
A_PASS: ${{ secrets.APPLE_PASSWORD }}
|
|
A_TEAM: ${{ secrets.APPLE_TEAM_ID }}
|
|
shell: bash
|
|
run: |
|
|
if [ -n "$CERT" ]; then
|
|
echo "APPLE_CERTIFICATE=$CERT" >> "$GITHUB_ENV"
|
|
echo "APPLE_CERTIFICATE_PASSWORD=$CERT_PASS" >> "$GITHUB_ENV"
|
|
echo "APPLE_SIGNING_IDENTITY=$SIGN_ID" >> "$GITHUB_ENV"
|
|
echo "APPLE_ID=$A_ID" >> "$GITHUB_ENV"
|
|
echo "APPLE_PASSWORD=$A_PASS" >> "$GITHUB_ENV"
|
|
echo "APPLE_TEAM_ID=$A_TEAM" >> "$GITHUB_ENV"
|
|
echo "Apple signing configured"
|
|
else
|
|
echo "No Apple certificate configured, skipping code signing"
|
|
fi
|
|
|
|
- name: Build and release
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
with:
|
|
projectPath: desktop
|
|
tauriScript: npx tauri
|
|
tagName: ${{ steps.release-info.outputs.tag }}
|
|
releaseName: ${{ steps.release-info.outputs.name }}
|
|
releaseBody: 'Desktop application built from ${{ github.sha }}'
|
|
releaseDraft: false
|
|
prerelease: ${{ steps.release-info.outputs.prerelease }}
|
|
includeUpdaterJson: true
|
|
args: ${{ matrix.args }}
|