Files
zuanbot/.github/workflows/package.yml
T
2025-07-28 14:04:03 +08:00

64 lines
1.5 KiB
YAML

name: Package and Publish
on:
workflow_dispatch:
pull_request:
types:
- closed
jobs:
build:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
name: Build Application Installer
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
with:
version: latest
- name: Setup Node
uses: actions/setup-node@v4.4.0
with:
node-version: 20
cache: 'pnpm'
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install Dependencies
run: pnpm install
- name: Build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: __VERSION__
releaseName: 'v__VERSION__'
args: ${{ matrix.args }}