Skip to content

style: cargo fmt

style: cargo fmt #12

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# macOS Universal (both aarch64 + x86_64 in one binary)
- platform: macos-latest
target: universal-apple-darwin
label: macOS-universal
# Windows x86_64
- platform: windows-latest
target: x86_64-pc-windows-msvc
label: Windows-x86_64
# Linux x86_64
- platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
label: Linux-x86_64
# Linux ARM64
- platform: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
label: Linux-aarch64
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target == 'universal-apple-darwin' && 'aarch64-apple-darwin,x86_64-apple-darwin' || matrix.target }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install Linux dependencies
if: contains(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libsoup-3.0-dev \
libjavascriptcoregtk-4.1-dev \
xdg-utils
- name: Install frontend dependencies
run: npm ci
- name: Build Tauri app
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:
tagName: ${{ github.ref_name }}
releaseName: "繁化姬 ${{ github.ref_name }}"
releaseBody: "See the assets below to download and install."
releaseDraft: false
prerelease: false
args: --target ${{ matrix.target }}
includeUpdaterJson: true
- name: Create Windows portable ZIP
if: contains(matrix.platform, 'windows')
shell: pwsh
run: |
$exe = Get-ChildItem -Path "src-tauri/target/${{ matrix.target }}/release" -Filter "Fanhuaji.exe" | Select-Object -First 1
if ($exe) {
$version = "${{ github.ref_name }}"
$zipName = "Fanhuaji-${version}-windows-portable.zip"
Compress-Archive -Path $exe.FullName -DestinationPath $zipName
gh release upload ${{ github.ref_name }} $zipName --clobber
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}