Skip to content

triggered by cjroth. #2

triggered by cjroth.

triggered by cjroth. #2

Workflow file for this run

name: Tauri v2 Release Process
run-name: triggered by ${{ github.actor }}.
on:
push:
tags:
- 'v*-rc*' # This will trigger on any tag matching v*-rc* (e.g., v1.0.0-rc1)
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
draft:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Get version from tag
id: get-version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get-version.outputs.version }}
name: Release ${{ steps.get-version.outputs.version }}
draft: true
prerelease: true
body: |
## Release Candidate ${{ steps.get-version.outputs.version }}
This is a release candidate. The final release will be created after successful builds.
### Downloads
Binaries will be attached to this release after successful builds.
build_desktop:
needs: draft
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
build_name: 'Linux'
- os: macos-latest
target: aarch64-apple-darwin
build_name: 'macOS (Apple Silicon)'
- os: macos-latest
target: x86_64-apple-darwin
build_name: 'macOS (Intel)'
- os: windows-latest
target: x86_64-pc-windows-msvc
build_name: 'Windows (x64)'
- os: windows-latest
target: aarch64-pc-windows-msvc
build_name: 'Windows (ARM64)'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: oven-sh/setup-bun@v2
- name: Install nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
cache: false
rustflags: ''
- name: Cache cargo registry and build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
${{ runner.os }}-cargo-
- name: install Linux dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libappindicator3-dev
- name: build Tauri app for Linux
if: matrix.os == 'ubuntu-22.04'
run: |
bun install
bun tauri build
env:
RUSTFLAGS: ''
CARGO_INCREMENTAL: 0
RUSTC_WRAPPER: ''
VITE_THUNDERBOLT_CLOUD_URL: ${{ vars.VITE_THUNDERBOLT_CLOUD_URL }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: build Tauri app for Windows (x86_64)
if: matrix.os == 'windows-latest' && matrix.target == 'x86_64-pc-windows-msvc'
run: |
bun install
bun tauri build --bundles msi,nsis --target x86_64-pc-windows-msvc -- --no-default-features --features native_fetch
env:
RUSTFLAGS: ''
CARGO_INCREMENTAL: 0
RUSTC_WRAPPER: ''
VITE_THUNDERBOLT_CLOUD_URL: ${{ vars.VITE_THUNDERBOLT_CLOUD_URL }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: build Tauri app for Windows (ARM64)
if: matrix.os == 'windows-latest' && matrix.target == 'aarch64-pc-windows-msvc'
run: |
# Install ARM64 target
rustup target add aarch64-pc-windows-msvc
# Build for ARM64
bun install
bun tauri build --bundles msi,nsis --target aarch64-pc-windows-msvc -- --no-default-features --features native_fetch
env:
RUSTFLAGS: ''
CARGO_INCREMENTAL: 0
RUSTC_WRAPPER: ''
VITE_THUNDERBOLT_CLOUD_URL: ${{ vars.VITE_THUNDERBOLT_CLOUD_URL }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Build Tauri app for macOS (Silicon)
if: matrix.os == 'macos-latest' && matrix.target == 'aarch64-apple-darwin'
run: |
bun install
bun tauri build --bundles app,dmg --target aarch64-apple-darwin
env:
RUSTFLAGS: ''
CARGO_INCREMENTAL: 0
RUSTC_WRAPPER: ''
VITE_THUNDERBOLT_CLOUD_URL: ${{ vars.VITE_THUNDERBOLT_CLOUD_URL }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Build Tauri app for macOS (Intel)
if: matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin'
run: |
# Install x86_64 target
rustup target add x86_64-apple-darwin
# Clean only the x86_64 target to avoid architecture conflicts
rm -rf src-tauri/target/x86_64-apple-darwin
# Build for Intel with proper environment
bun install
bun tauri build --bundles app,dmg --target x86_64-apple-darwin
env:
# Override the target-cpu=native flag
RUSTFLAGS: '-C target-cpu=x86-64'
CARGO_INCREMENTAL: 0
RUSTC_WRAPPER: ''
# Set C compiler for cross-compilation
CC_x86_64_apple_darwin: 'clang -target x86_64-apple-darwin'
CXX_x86_64_apple_darwin: 'clang++ -target x86_64-apple-darwin'
AR_x86_64_apple_darwin: 'ar'
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER: 'clang'
VITE_THUNDERBOLT_CLOUD_URL: ${{ vars.VITE_THUNDERBOLT_CLOUD_URL }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Upload Linux artifacts to GitHub Release
if: matrix.os == 'ubuntu-22.04'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.draft.outputs.version }}
draft: true
files: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/rpm/*.rpm
- name: Upload Windows artifacts to GitHub Release
if: matrix.os == 'windows-latest'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.draft.outputs.version }}
draft: true
files: |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe
src-tauri/target/aarch64-pc-windows-msvc/release/bundle/msi/*.msi
src-tauri/target/aarch64-pc-windows-msvc/release/bundle/nsis/*.exe
- name: Upload macOS artifacts to GitHub Release
if: matrix.os == 'macos-latest'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.draft.outputs.version }}
draft: true
files: |
src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app.tar.gz
src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg
src-tauri/target/x86_64-apple-darwin/release/bundle/macos/*.app.tar.gz
build_android:
needs: draft
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: oven-sh/setup-bun@v2
- name: Install nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
cache: false
rustflags: ''
- name: Cache cargo registry and build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
${{ runner.os }}-cargo-
- name: setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: setup Android SDK
uses: android-actions/setup-android@v3
- name: setup Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26d
link-to-sdk: true
- name: install Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
# TODO: Add Android signing
# - name: setup Android signing
# working-directory: src-tauri/gen/android
# run: |
# echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
# echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
# base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
# echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
# - name: build Tauri app for Android
# env:
# NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
# run: |
# bun install
# bun tauri android build
build_ios:
needs: draft
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: oven-sh/setup-bun@v2
- name: Install nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
cache: false
rustflags: ''
- name: Cache cargo registry and build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
${{ runner.os }}-cargo-
- name: install iOS target
run: rustup target add aarch64-apple-ios
- name: setup xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
# TODO: Add iOS signing
# - name: setup Apple API key
# run: |
# APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8"
# echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH
# echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV
# echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
# - name: build Tauri app for iOS
# env:
# APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }}
# APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
# APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE>
# run: |
# bun install
# bun tauri ios build --export-method app-store-connect
publish:
needs: [build_desktop]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper tagging
- name: Get version info
id: get-version
run: |
# Extract version from RC tag (e.g., v1.0.0-rc1 -> v1.0.0)
RC_VERSION=${GITHUB_REF#refs/tags/}
FINAL_VERSION=${RC_VERSION%-rc*}
echo "rc_version=$RC_VERSION" >> $GITHUB_OUTPUT
echo "final_version=$FINAL_VERSION" >> $GITHUB_OUTPUT
- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.draft.outputs.version }}
draft: false
prerelease: false
name: Release ${{ steps.get-version.outputs.final_version }}
body: |
## Release ${{ steps.get-version.outputs.final_version }}
### Downloads
Download the appropriate installer for your platform below.
#### Desktop
- **Windows**: `.msi` or `.exe` installer
- **macOS**: `.dmg` installer (Intel and Apple Silicon)
- **Linux**: `.AppImage`, `.deb`, or `.rpm` package
### Release Notes
_Add your release notes here_
---
**Note:** This release was built from RC tag `${{ steps.get-version.outputs.rc_version }}`.
To create the final release tag after verification:
```bash
git tag ${{ steps.get-version.outputs.final_version }}
git push origin ${{ steps.get-version.outputs.final_version }}
```