- macOS/Windows 失败: 'tauri' 命令找不到 → 实际是 npm 依赖没装 tauri-action 不会自动 npm install, 需显式 npm ci - Linux apt 冲突: libappindicator3-dev 与 libayatana-appindicator3-dev 互斥 保留后者 (Tauri 2 推荐)
90 lines
2.3 KiB
YAML
90 lines
2.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
version-check:
|
|
name: Version consistency
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- name: Verify tag matches package.json / Cargo.toml / tauri.conf.json
|
|
run: |
|
|
TAG="${GITHUB_REF_NAME}"
|
|
chmod +x scripts/check-version.sh
|
|
./scripts/check-version.sh "$TAG"
|
|
|
|
build:
|
|
name: Build (${{ matrix.platform }})
|
|
needs: version-check
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: ubuntu-latest
|
|
args: --bundles deb,appimage,rpm
|
|
- platform: macos-latest
|
|
args: --bundles app,dmg
|
|
- platform: windows-latest
|
|
args: --bundles msi
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
cache: true
|
|
|
|
- name: Install Linux build dependencies
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
build-essential \
|
|
curl \
|
|
wget \
|
|
file \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
libayatana-appindicator3-dev
|
|
|
|
- name: Build and upload release
|
|
uses: tauri-apps/tauri-action@v0
|
|
with:
|
|
tagName: ${{ github.ref_name }}
|
|
releaseName: ${{ github.ref_name }}
|
|
releaseBody: |
|
|
## ${{ github.ref_name }}
|
|
|
|
### Downloads by platform
|
|
|
|
- **Windows**: `.msi` installer
|
|
- **macOS**: `.dmg` (unsigned — first launch needs right-click → Open) + `.app`
|
|
- **Linux**: `.deb` / `.AppImage` / `.rpm`
|
|
|
|
Full changelog: see commit history.
|
|
releaseDraft: true
|
|
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
|
|
args: ${{ matrix.args }}
|