fix: set GOOS/GOARCH for correct cross-compilation in release #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
GOOS/GOARCH/CGO_ENABLED=0环境变量,确保交叉编译产物架构与文件名匹配can_test字段,跳过无法在当前 runner 上执行的交叉编译二进制测试Problem
Release workflow 的
go build没有设置GOOS/GOARCH,导致所有构建使用 runner 原生架构:macos-latest(arm64) →codes-darwin-amd64实际是 arm64 ❌ubuntu-latest(amd64) →codes-linux-arm64实际是 amd64 ❌windows-latest(amd64) →codes-windows-arm64实际是 amd64 ❌Test plan
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build产物经file确认为 ARM aarch64Closes #3