ACT丶流星雨 cdc874c228 完善gitflow
2026-04-03 01:38:06 +08:00

173 lines
4.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build and Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version number (e.g., 1.0.0)"
required: false
type: string
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build application
run: yarn build
- name: Build Windows installer
run: yarn dist:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-builds
path: |
dist/*.exe
retention-days: 30
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build application
run: yarn build
- name: Build macOS installer
run: yarn dist:mac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-builds
path: |
dist/*.dmg
retention-days: 30
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build application
run: yarn build
- name: Build Linux installer
run: yarn dist:linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-builds
path: |
dist/*.AppImage
retention-days: 30
release:
needs: [build-windows, build-macos, build-linux]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows-builds
path: dist
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: macos-builds
path: dist
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-builds
path: dist
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ToonFlow ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
generate_release_notes: true
body: |
## 📦 下载指南
| 操作系统 | 架构 | 文件 | 说明 |
|---------|------|------|------|
| 🪟 Windows | x64 | `ToonFlow-*-win-x64-setup.exe` | **推荐**,适用于大多数 Windows 电脑 |
| 🪟 Windows | ARM64 | `ToonFlow-*-win-arm64-setup.exe` | 适用于 ARM 架构 Windows 设备 |
| 🍎 macOS | Apple Silicon | `ToonFlow-*-mac-arm64.dmg` | 适用于 M1/M2/M3/M4 芯片的 Mac |
| 🍎 macOS | Intel | `ToonFlow-*-mac-x64.dmg` | 适用于 Intel 芯片的 Mac |
| 🐧 Linux | x64 | `ToonFlow-*-linux-x64.AppImage` | 适用于大多数 Linux 发行版 |
| 🐧 Linux | ARM64 | `ToonFlow-*-linux-arm64.AppImage` | 适用于 ARM 架构 Linux 设备 |
> 💡 **不确定选哪个?** Windows 用户通常选 **x64-setup.exe**Mac 用户查看「关于本机」M 系列芯片选 **arm64.dmg**Intel 选 **x64.dmg**。
## 🚀 安装说明
- **Windows**:下载 `.exe` 文件,双击运行安装向导即可。如果运行时出现 DLL 缺失或闪退,请先安装 [Microsoft Visual C++ Redistributable (x64)](https://aka.ms/vs/17/release/vc_redist.x64.exe)。
- **macOS**:下载 `.dmg` 文件,打开后将 ToonFlow 拖入「应用程序」文件夹。首次打开如遇安全提示,请前往「系统设置 → 隐私与安全性」中允许运行。
- **Linux**:下载 `.AppImage` 文件,执行 `chmod +x ToonFlow-*.AppImage` 后双击运行。
---
files: |
dist/*.exe
dist/*.dmg
dist/*.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}