Skip to content

Build and Release Tauri App #7

Build and Release Tauri App

Build and Release Tauri App #7

name: Build and Release Tauri App
on:
workflow_dispatch:
jobs:
build-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: "--target universal-apple-darwin"
os: macos
- platform: ubuntu-22.04
args: ""
os: linux
- platform: windows-latest
args: ""
os: windows
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.15.4
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Cache Rust artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
src-tauri/target/
C:\Users\runneradmin\.cargo\registry\index\
C:\Users\runneradmin\.cargo\registry\cache\
C:\Users\runneradmin\.cargo\git\db\
key: ${{ runner.os }}-${{ matrix.args }}-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Export updater signing key (unix)
if: matrix.platform != 'windows-latest'
run: echo "TAURI_SIGNING_PRIVATE_KEY=${{ secrets.TAURI_PRIVATE_KEY }}" >> $GITHUB_ENV
- name: Export updater signing key (windows)
if: matrix.platform == 'windows-latest'
run: echo "TAURI_SIGNING_PRIVATE_KEY=${{ secrets.TAURI_PRIVATE_KEY }}" >> $GITHUB_ENV
shell: bash
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Import Apple code signing certificates
if: matrix.platform == 'macos-latest'
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain: build
- name: Set APPLE_SIGNING_IDENTITY from imported certificate
if: matrix.platform == 'macos-latest'
run: |
security find-identity -v -p codesigning
ID=$(security find-identity -v -p codesigning | grep "Developer ID Application" | head -1 | awk -F'"' '{print $2}')
if [ -z "$ID" ]; then
echo "No Developer ID Application identity found after import."
exit 1
fi
echo "APPLE_SIGNING_IDENTITY=$ID" >> "$GITHUB_ENV"
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
tagName: app-v__VERSION__
appName: vtracer-app_${{ matrix.os }}
releaseName: Release v__VERSION__
releaseBody: See the assets to download this version and install.
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
includeUpdaterJson: true
updaterJsonPreferNsis: true
includeDebug: false
includeRelease: true