Skip to content

Merge pull request #12 from TechCat-Team/develop #22

Merge pull request #12 from TechCat-Team/develop

Merge pull request #12 from TechCat-Team/develop #22

Workflow file for this run

name: Tauri Build & Release
on:
push:
tags:
- "v*"
jobs:
release:
name: Tauri Build (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
- platform: macos-13
- platform: ubuntu-latest
- platform: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.6
- name: Enable sccache
run: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Extract changelog for current version
id: changelog
shell: bash
run: |
VERSION="${GITHUB_REF_NAME}"
echo "Extracting changelog for $VERSION"
awk "
/^## ${VERSION}$/ {flag=1; next}
/^## v/ && flag {exit}
flag {print}
" CHANGELOG.md > RELEASE_NOTES.md
echo "changelog<<EOF" >> $GITHUB_OUTPUT
cat RELEASE_NOTES.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Build & Release with Tauri
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
RUSTC_WRAPPER: sccache
with:
packageManager: pnpm
includeRelease: true
tagName: ${{ github.ref_name }}
releaseName: 'ChmlFrpLauncher ${{ github.ref_name }}'
releaseBody: |
## 🚀 更新内容
${{ steps.changelog.outputs.changelog }}
releaseDraft: false
prerelease: false