Windows ARM64 使用场景极少,windows-11-arm runner 上 MSYS2 CLANGARM64 交叉编译不稳定,CGO 编译问题难以排查,维护成本 远超收益。移除 arm64 的 CI 矩阵条目、Makefile Windows 变量、 versionctl 资产白名单、README 文档和规范中的相关需求。 Linux 和 macOS arm64 不受影响。
307 lines
7.6 KiB
YAML
307 lines
7.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Prepare Release
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache-dependency-path: |
|
|
backend/go.sum
|
|
versionctl/go.sum
|
|
|
|
- name: Verify tag and VERSION
|
|
id: version
|
|
run: |
|
|
version=$(go run ./versionctl print)
|
|
go run ./versionctl verify-tag "${GITHUB_REF_NAME}"
|
|
printf 'version=%s\n' "$version" >> "$GITHUB_OUTPUT"
|
|
|
|
build-web:
|
|
name: Build Web Asset
|
|
needs: prepare
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache-dependency-path: |
|
|
backend/go.sum
|
|
versionctl/go.sum
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Preflight web release toolchain
|
|
run: |
|
|
set -euo pipefail
|
|
command -v go
|
|
go version
|
|
command -v bun
|
|
bun --version
|
|
make release-assets-check
|
|
|
|
- name: Build web release asset
|
|
run: make release-assets-web
|
|
|
|
- name: Upload web release asset
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-web
|
|
path: build/release/*
|
|
if-no-files-found: error
|
|
|
|
build-linux:
|
|
name: Build Linux ${{ matrix.arch }} Assets
|
|
needs: prepare
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: amd64
|
|
runner: ubuntu-latest
|
|
- arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
runs-on: ${{ matrix.runner }}
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache-dependency-path: |
|
|
backend/go.sum
|
|
versionctl/go.sum
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Install Linux desktop and package dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y curl file libayatana-appindicator3-dev libgtk-3-dev rpm
|
|
|
|
- name: Preflight Linux release toolchain
|
|
run: |
|
|
set -euo pipefail
|
|
printf 'runner arch: %s\n' "$(uname -m)"
|
|
command -v go
|
|
go version
|
|
command -v bun
|
|
bun --version
|
|
command -v gcc
|
|
gcc --version
|
|
command -v pkg-config
|
|
pkg-config --modversion ayatana-appindicator3-0.1
|
|
pkg-config --modversion gtk+-3.0
|
|
command -v curl
|
|
command -v dpkg-deb
|
|
dpkg-deb --version
|
|
command -v rpmbuild
|
|
rpmbuild --version
|
|
make release-assets-check
|
|
|
|
- name: Build Linux release assets
|
|
run: make release-assets-linux
|
|
|
|
- name: Upload Linux release assets
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-linux-${{ matrix.arch }}
|
|
path: build/release/*
|
|
if-no-files-found: error
|
|
|
|
build-windows:
|
|
name: Build Windows ${{ matrix.arch }} Assets
|
|
needs: prepare
|
|
runs-on: ${{ matrix.runner }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: amd64
|
|
runner: windows-latest
|
|
msystem: MINGW64
|
|
cc: gcc
|
|
cxx: g++
|
|
packages: >-
|
|
make
|
|
mingw-w64-x86_64-gcc
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache-dependency-path: |
|
|
backend/go.sum
|
|
versionctl/go.sum
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Setup MSYS2 toolchain
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: ${{ matrix.msystem }}
|
|
path-type: inherit
|
|
update: true
|
|
install: ${{ matrix.packages }}
|
|
|
|
- name: Preflight Windows release toolchain
|
|
shell: msys2 {0}
|
|
env:
|
|
CC: ${{ matrix.cc }}
|
|
CXX: ${{ matrix.cxx }}
|
|
run: |
|
|
set -euo pipefail
|
|
command -v go
|
|
go version
|
|
command -v bun
|
|
bun --version
|
|
command -v make
|
|
make --version
|
|
command -v "$CC"
|
|
"$CC" --version
|
|
command -v "$CXX"
|
|
"$CXX" --version
|
|
command -v windres
|
|
windres --version
|
|
if command -v powershell.exe >/dev/null 2>&1; then
|
|
powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
|
|
else
|
|
command -v powershell
|
|
powershell -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
|
|
fi
|
|
make release-assets-check
|
|
|
|
- name: Build Windows release assets
|
|
shell: msys2 {0}
|
|
env:
|
|
CC: ${{ matrix.cc }}
|
|
CXX: ${{ matrix.cxx }}
|
|
run: make release-assets-windows
|
|
|
|
- name: Upload Windows release assets
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-windows-${{ matrix.arch }}
|
|
path: build/release/*
|
|
if-no-files-found: error
|
|
|
|
build-macos:
|
|
name: Build macOS Assets
|
|
needs: prepare
|
|
runs-on: macos-15
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache-dependency-path: |
|
|
backend/go.sum
|
|
versionctl/go.sum
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Preflight macOS release toolchain
|
|
run: |
|
|
set -euo pipefail
|
|
printf 'runner arch: %s\n' "$(uname -m)"
|
|
command -v go
|
|
go version
|
|
command -v bun
|
|
bun --version
|
|
command -v ditto
|
|
command -v hdiutil
|
|
xcrun --find lipo
|
|
xcrun --find vtool
|
|
make release-assets-check
|
|
|
|
- name: Build macOS release assets
|
|
run: make release-assets-macos
|
|
|
|
- name: Upload macOS release assets
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-macos
|
|
path: build/release/*
|
|
if-no-files-found: error
|
|
|
|
draft-release:
|
|
name: Create Draft Release
|
|
needs: [prepare, build-web, build-linux, build-windows, build-macos]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Download release assets
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: release-*
|
|
merge-multiple: true
|
|
path: dist
|
|
|
|
- name: Generate checksums
|
|
run: make release-assets-checksums RELEASE_DIR=dist
|
|
|
|
- name: Publish draft release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: v${{ needs.prepare.outputs.version }}
|
|
tag_name: ${{ github.ref_name }}
|
|
draft: true
|
|
files: |
|
|
dist/*
|