Skip to content

Build and release

Build and release #40

Workflow file for this run

name: Build and release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
# 检出存储库
- name: Checkout repository
uses: actions/checkout@v4
# 设置 rust 环境
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
# rust 缓存
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
# 设置 node 环境
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
# 全局安装pnpm
- name: Install pnpm
run: npm install -g pnpm
# 安装前端依赖
- name: Install frontend dependencies
run: pnpm install
# 构建应用
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
releaseName: 'XTools v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
releaseBody: 'See the assets to download and install this version.'
releaseDraft: true
prerelease: false