Files
sundynix-agentix/.github/workflows/release.yml
T

81 lines
3.2 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: Release
# 打 vX.Y.Z 标签即触发:各平台用 wails3 构建桌面端 → 发布到 GitHub Release。
# 用户旧版 App 启动时查 /releases/latest,发现新版即提示下载(见 frontend/src/lib/version.ts)。
on:
push:
tags: ["v*"]
permissions:
contents: write # 创建 release + 上传产物需要
env:
# 必须与 sundynix-desktop/go.mod 里的 wails/v3 版本一致:alpha 阶段 CLI 生成的
# bindings 与运行时是配套的,版本错开会出难查的怪问题。升级时两处一起改。
WAILS3_VERSION: v3.0.0-alpha2.117
jobs:
build:
name: 构建 ${{ matrix.label }}
# 只在 GitHub 跑;Gitea(git.sundynix.cn)不跑桌面端发布构建。
if: ${{ !contains(github.server_url, 'sundynix.cn') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
label: macOS (universal)
asset: sundynix_desktop_macos_universal.zip
- os: windows-latest
label: Windows (amd64)
asset: sundynix_desktop_windows_amd64.exe
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: 安装 wails3 CLI
run: go install github.com/wailsapp/wails/v3/cmd/wails3@${{ env.WAILS3_VERSION }}
# v3 的 build 只出裸二进制(macOS 上双击不起窗),必须 package 才有 .app
# universal 走 darwin:package:universal:分别编 amd64/arm64 再 lipo 合并。
# 任务链自带 npm install + generate:bindings,故不需要单独的前端构建步骤。
- name: 构建 macOS .appuniversal
if: runner.os == 'macOS'
working-directory: sundynix-desktop
env:
GOWORK: "off" # 必须加引号:YAML 裸 off 会被解析成布尔 false,使 workflow 校验不合法而不触发
run: wails3 task darwin:package:universal
# Windows 沿用 v2 时代的行为:发裸 .exe。v3 的 package 默认走 NSIS 出 installer
# 需 runner 上有 makensis,属于额外未知数,要升级安装包再单独议。
- name: 构建 Windows .exe
if: runner.os == 'Windows'
working-directory: sundynix-desktop
env:
GOWORK: "off"
run: wails3 build
# macOS.app 是目录,打包成 zip 才能作为单文件资产分发。
- name: 打包 macOS 产物
if: runner.os == 'macOS'
working-directory: sundynix-desktop/bin
run: zip -r -y ${{ matrix.asset }} sundynix_desktop.app
- name: 重命名 Windows 产物
if: runner.os == 'Windows'
working-directory: sundynix-desktop/bin
run: Rename-Item sundynix_desktop.exe ${{ matrix.asset }}
# fail_on_unmatched_files 必须为 true:产物路径写错时要当场炸,而不是安静地
# 发一个没有附件的 Release。v2→v3 迁移正是把产物从 build/bin 挪到了 bin。
- name: 发布到 GitHub Release(按 tag 创建/追加资产)
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
files: sundynix-desktop/bin/${{ matrix.asset }}