Skip to content

Conversation

@ourines
Copy link
Owner

@ourines ourines commented Feb 10, 2026

Summary

  • Build step 添加 GOOS/GOARCH/CGO_ENABLED=0 环境变量,确保交叉编译产物架构与文件名匹配
  • Matrix 添加 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 aarch64
  • 推送 tag 触发 release workflow,检查产物架构是否正确

Closes #3

Release binaries had mismatched architectures because go build used the
runner's native arch instead of the target arch from the matrix. Add
GOOS, GOARCH and CGO_ENABLED=0 env vars to the build step, and skip
tests for cross-compiled binaries that can't run on the runner.

Closes #3
@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Warning

Rate limit exceeded

@ourines has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/release-binary-arch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ourines ourines merged commit 90f8afa into main Feb 10, 2026
2 checks passed
@ourines ourines deleted the fix/release-binary-arch branch February 10, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

binary arch problems

1 participant