mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-06 20:42:52 +08:00
Create workflow.yml
This commit is contained in:
59
.github/workflows/main.yml
vendored
Normal file
59
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# .github/workflows/release.yml
|
||||||
|
name: Build Desktop App (Python Backend + Tauri Frontend)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*' # 发布 tag 时触发
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [macos-latest, ubuntu-latest, windows-latest]
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# 设置 Python 环境
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
# 安装 Python 依赖并执行你的 build.sh
|
||||||
|
- name: Install Python dependencies & Build backend
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r backend/requirements.txt
|
||||||
|
chmod +x backend/build.sh
|
||||||
|
./backend/build.sh
|
||||||
|
|
||||||
|
# 设置 Node 环境 + 安装前端依赖
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Enable Corepack + Install pnpm
|
||||||
|
run: |
|
||||||
|
corepack enable
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# 设置 Rust 环境
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
# 打包 Tauri 应用
|
||||||
|
- name: Build Tauri App
|
||||||
|
run: pnpm tauri build
|
||||||
|
|
||||||
|
# 可选:上传构建产物
|
||||||
|
- name: Upload Desktop Bundle
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: app-${{ matrix.platform }}
|
||||||
|
path: src-tauri/target/release/bundle/
|
||||||
Reference in New Issue
Block a user