Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 394025c8ea | |||
| 34bd749741 |
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -156,12 +156,16 @@ jobs:
|
||||
- arch: amd64
|
||||
runner: windows-latest
|
||||
msystem: MINGW64
|
||||
cc: gcc
|
||||
cxx: g++
|
||||
packages: >-
|
||||
make
|
||||
mingw-w64-x86_64-gcc
|
||||
- arch: arm64
|
||||
runner: windows-11-arm
|
||||
msystem: CLANGARM64
|
||||
cc: clang
|
||||
cxx: clang++
|
||||
packages: >-
|
||||
make
|
||||
mingw-w64-clang-aarch64-clang
|
||||
@@ -195,6 +199,9 @@ jobs:
|
||||
|
||||
- name: Preflight Windows release toolchain
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
CXX: ${{ matrix.cxx }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
command -v go
|
||||
@@ -203,9 +210,11 @@ jobs:
|
||||
bun --version
|
||||
command -v make
|
||||
make --version
|
||||
command -v "$CC"
|
||||
"$CC" --version
|
||||
command -v "$CXX"
|
||||
"$CXX" --version
|
||||
if [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||
command -v clang
|
||||
clang --version
|
||||
if command -v llvm-windres >/dev/null 2>&1; then
|
||||
llvm-windres --version
|
||||
else
|
||||
@@ -213,8 +222,6 @@ jobs:
|
||||
windres --version
|
||||
fi
|
||||
else
|
||||
command -v gcc
|
||||
gcc --version
|
||||
command -v windres
|
||||
windres --version
|
||||
fi
|
||||
@@ -228,6 +235,9 @@ jobs:
|
||||
|
||||
- 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
|
||||
|
||||
6
Makefile
6
Makefile
@@ -116,6 +116,7 @@ desktop-build-mac: version-check _desktop-prepare-frontend _desktop-prepare-embe
|
||||
cd backend && CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags "$(GO_LDFLAGS)" -o ../build/nex-mac-amd64 ./cmd/desktop
|
||||
lipo -create build/nex-mac-arm64 build/nex-mac-amd64 -output build/nex-mac-universal
|
||||
lipo -info build/nex-mac-universal | grep -q 'x86_64 arm64'
|
||||
rm -f build/nex-mac-arm64 build/nex-mac-amd64
|
||||
@printf 'Packaging macOS app bundle...\n'
|
||||
rm -rf build/Nex.app
|
||||
mkdir -p build/Nex.app/Contents/MacOS build/Nex.app/Contents/Resources
|
||||
@@ -241,6 +242,7 @@ release-assets-server-macos: version-check
|
||||
tar -C build -czf "$(RELEASE_DIR)/$$asset" nex-server-macos-arm64
|
||||
asset=$$(go run ./versionctl asset-name server macos universal tar.gz); \
|
||||
tar -C build -czf "$(RELEASE_DIR)/$$asset" nex-server-macos-universal
|
||||
rm -f build/nex-server-macos-amd64 build/nex-server-macos-arm64 build/nex-server-macos-universal
|
||||
|
||||
release-assets-desktop-linux: version-check release-assets-check desktop-build-linux _package-linux-tar _package-linux-appimage _package-linux-deb _package-linux-rpm
|
||||
|
||||
@@ -251,6 +253,7 @@ release-assets-desktop-windows: version-check release-assets-check desktop-build
|
||||
"$$POWERSHELL" -NoProfile -Command "Compress-Archive -LiteralPath '$(WINDOWS_DESKTOP_BINARY)' -DestinationPath '$(RELEASE_DIR)/$$asset' -Force"
|
||||
|
||||
release-assets-desktop-macos: version-check release-assets-check desktop-build-mac _package-macos-zip _package-macos-dmg
|
||||
rm -rf build/Nex.app build/dmg
|
||||
|
||||
release-assets-checksums:
|
||||
@cd "$(RELEASE_DIR)" && \
|
||||
@@ -366,7 +369,8 @@ _package-macos-dmg:
|
||||
ln -s /Applications "$$dmgdir/Applications"; \
|
||||
asset=$$(go run ./versionctl asset-name desktop macos universal dmg); \
|
||||
hdiutil create -volname Nex -srcfolder "$$dmgdir" -ov -format UDZO "$(RELEASE_DIR)/$$asset"; \
|
||||
hdiutil verify "$(RELEASE_DIR)/$$asset" >/dev/null
|
||||
hdiutil verify "$(RELEASE_DIR)/$$asset" >/dev/null && \
|
||||
rm -rf "$$dmgdir"
|
||||
|
||||
# ============================================
|
||||
# 共享 helper targets
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
VITE_API_BASE=
|
||||
VITE_APP_VERSION=0.1.4
|
||||
VITE_APP_VERSION=0.1.5
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
VITE_API_BASE=
|
||||
VITE_APP_VERSION=0.1.4
|
||||
VITE_APP_VERSION=0.1.5
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
VITE_API_BASE=/api
|
||||
VITE_APP_VERSION=0.1.4
|
||||
VITE_APP_VERSION=0.1.5
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"private": true,
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -120,6 +120,22 @@
|
||||
- **THEN** 发布流水线 SHALL 在正式构建前失败
|
||||
- **AND** 系统 SHALL 在日志中标识缺失的工具链名称
|
||||
|
||||
### Requirement: Windows arm64 CGO 编译器指定
|
||||
|
||||
系统 SHALL 在 Windows arm64 发布构建中显式指定 `CC=clang` 和 `CXX=clang++` 环境变量,确保 Go cgo 在 MSYS2 CLANGARM64 环境下使用正确的 C 编译器进行 `windows/arm64` 交叉编译。
|
||||
|
||||
#### Scenario: Windows arm64 构建使用 clang
|
||||
|
||||
- **WHEN** 发布流水线在 `windows-11-arm` runner 上执行 Windows arm64 构建步骤
|
||||
- **THEN** 构建步骤 SHALL 将 `CC=clang` 和 `CXX=clang++` 注入 go build 环境
|
||||
- **AND** Go cgo SHALL 使用 `clang` 编译 `runtime/cgo` 等 CGO 组件
|
||||
|
||||
#### Scenario: Windows amd64 构建保持 gcc
|
||||
|
||||
- **WHEN** 发布流水线在 `windows-latest` runner 上执行 Windows amd64 构建步骤
|
||||
- **THEN** 构建步骤 MAY 显式指定 `CC=gcc` 和 `CXX=g++` 或依赖 Go 默认编译器探测
|
||||
- **AND** 显式指定的 `gcc` SHALL 等价于 MSYS2 MINGW64 默认 C 编译器(`x86_64-w64-mingw32-gcc`)
|
||||
|
||||
### Requirement: 发布流水线 LFS 资产拉取
|
||||
|
||||
发布流水线 SHALL 在所有会 checkout 仓库并参与版本校验、web 构建、server 构建或 desktop 构建的 job 中拉取 Git LFS 真实文件,确保发布构建读取到真实二进制资产而非 LFS pointer 文本。
|
||||
|
||||
Reference in New Issue
Block a user