HuLa/.github/workflows/release.yml

67 lines
1.6 KiB
YAML
Raw Normal View History

name: Release CI
on:
push:
tags:
2024-03-09 04:04:05 +08:00
- 'v*'
workflow_dispatch:
2024-03-09 04:04:05 +08:00
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
2024-03-09 04:04:05 +08:00
jobs:
publish:
strategy:
fail-fast: false
matrix:
2024-03-09 04:04:05 +08:00
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
2024-03-09 04:04:05 +08:00
- uses: actions/checkout@v4
# 安装 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
with:
2024-07-03 18:59:13 +08:00
node-version: '20'
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm@9.2.0
# 安装 Rust
2024-03-09 04:04:05 +08:00
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
2024-07-03 18:59:13 +08:00
- name: Install dependencies
run: pnpm install
- name: Build Vite + Tauri
run: pnpm build
- name: Create release
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_PRIVATE_KEY_PASSWORD }}
with:
tagName: v__VERSION__ #这个动作会自动将\_\_VERSION\_\_替换为app version
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
- name: Upload assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 运行脚本上传latest.json文件
run: node scripts/updater.mjs