mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-07 06:12:58 +08:00
- 添加 README、LICENSE (MIT)、CONTRIBUTING、CHANGELOG - 添加 GitHub Issue/PR 模板和 FUNDING 配置 - 添加 CI/CD 工作流(ci.yml + release.yml) - 添加项目文档页面 (docs/index.html) - 添加 logo 和社群二维码图片资源 - 添加开发和构建脚本 (dev.sh + build.sh) - 更新 package-lock.json 依赖
88 lines
2.3 KiB
YAML
88 lines
2.3 KiB
YAML
# ClawPanel 发布构建工作流
|
|
# 推送 v* 标签时自动构建跨平台产物并创建 GitHub Release
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
release:
|
|
name: 构建 (${{ matrix.platform.name }})
|
|
runs-on: ${{ matrix.platform.os }}
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
# macOS Apple Silicon (ARM64)
|
|
- name: macOS (ARM64)
|
|
os: macos-latest
|
|
args: --target aarch64-apple-darwin
|
|
# Linux x86_64
|
|
- name: Linux (x64)
|
|
os: ubuntu-latest
|
|
args: ""
|
|
# Windows x86_64
|
|
- name: Windows (x64)
|
|
os: windows-latest
|
|
args: ""
|
|
|
|
steps:
|
|
# 签出代码
|
|
- name: 签出代码
|
|
uses: actions/checkout@v4
|
|
|
|
# 安装 Node.js 22
|
|
- name: 安装 Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
|
|
# 安装前端依赖
|
|
- name: 安装前端依赖
|
|
run: npm ci
|
|
|
|
# 安装 Rust 工具链 (stable)
|
|
- name: 安装 Rust 工具链
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
# macOS ARM64 需要指定 target
|
|
targets: ${{ matrix.platform.os == 'macos-latest' && 'aarch64-apple-darwin' || '' }}
|
|
|
|
# Rust 编译缓存
|
|
- name: Rust 编译缓存
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri -> target
|
|
|
|
# Linux 专用: 安装 Tauri v2 系统依赖
|
|
- name: 安装 Linux 系统依赖
|
|
if: matrix.platform.os == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libappindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
libayatana-appindicator3-dev
|
|
|
|
# 使用 tauri-action 构建并发布
|
|
- name: 构建 Tauri 应用
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tagName: ${{ github.ref_name }}
|
|
releaseName: "ClawPanel ${{ github.ref_name }}"
|
|
releaseBody: "详细变更记录请查看提交历史。"
|
|
releaseDraft: true
|
|
prerelease: false
|
|
args: ${{ matrix.platform.args }}
|