2024-03-09 03:39:35 +08:00
|
|
|
name: Release CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2024-03-09 04:04:05 +08:00
|
|
|
- 'v*'
|
|
|
|
workflow_dispatch:
|
2024-03-09 03:39:35 +08:00
|
|
|
|
2024-03-09 04:04:05 +08:00
|
|
|
concurrency:
|
|
|
|
group: release-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2024-03-09 03:39:35 +08:00
|
|
|
|
2024-03-09 04:04:05 +08:00
|
|
|
jobs:
|
|
|
|
publish:
|
2024-03-09 03:39:35 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-03-09 04:04:05 +08:00
|
|
|
platform: [macos-latest, windows-latest]
|
2024-03-09 03:39:35 +08:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
2024-03-09 04:04:05 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-09 03:39:35 +08:00
|
|
|
|
2024-03-10 11:54:46 +08:00
|
|
|
# 安装 Node.js
|
2024-07-03 18:59:13 +08:00
|
|
|
- name: Setup Node
|
2024-03-09 04:04:05 +08:00
|
|
|
uses: actions/setup-node@v4
|
2024-03-09 03:39:35 +08:00
|
|
|
with:
|
2024-07-03 18:59:13 +08:00
|
|
|
node-version: '20'
|
|
|
|
|
|
|
|
# 安装 pnpm
|
|
|
|
- name: Install pnpm
|
|
|
|
run: npm install -g pnpm@9.2.0
|
2024-03-09 03:39:35 +08:00
|
|
|
|
2024-03-10 11:54:46 +08:00
|
|
|
# 安装 Rust
|
2024-03-09 04:04:05 +08:00
|
|
|
- name: install Rust stable
|
2024-03-09 03:39:35 +08:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
|
2024-07-03 18:59:13 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
2024-03-09 03:39:35 +08:00
|
|
|
- name: Build Vite + Tauri
|
|
|
|
run: pnpm build
|
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
uses: tauri-apps/tauri-action@v0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2024-10-26 16:27:42 +08:00
|
|
|
# 使用之前配置的私钥`
|
|
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
|
|
# 使用之前配置的私钥密码
|
|
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }}
|
2024-03-09 03:39:35 +08:00
|
|
|
with:
|
2024-03-10 11:54:46 +08:00
|
|
|
tagName: v__VERSION__ #这个动作会自动将\_\_VERSION\_\_替换为app version
|
2024-03-09 03:39:35 +08:00
|
|
|
releaseName: 'v__VERSION__'
|
|
|
|
releaseBody: 'See the assets to download and install this version.'
|
|
|
|
releaseDraft: true
|
2024-07-03 18:59:13 +08:00
|
|
|
prerelease: false
|
2024-10-26 16:57:28 +08:00
|
|
|
|
|
|
|
- name: Upload assets
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# 运行脚本上传latest.json文件
|
|
|
|
run: node scripts/updater.mjs
|
|
|
|
|