go-binary-release.yml 1011 B

12345678910111213141516171819202122232425262728
  1. name: build
  2. on:
  3. release:
  4. types: [created,published] # 表示在创建新的 Release 时触发
  5. jobs:
  6. build-go-binary:
  7. runs-on: ubuntu-latest
  8. strategy:
  9. matrix:
  10. goos: [linux, windows, darwin] # 需要打包的系统
  11. goarch: ["386", amd64, arm64] # 需要打包的架构
  12. exclude: # 排除某些平台和架构
  13. - goarch: "386"
  14. goos: darwin
  15. - goarch: arm64
  16. goos: windows
  17. steps:
  18. - uses: actions/checkout@v3
  19. - uses: wangyoucao577/go-release-action@v1.30
  20. with:
  21. github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
  22. goos: ${{ matrix.goos }}
  23. goarch: ${{ matrix.goarch }}
  24. goversion: 1.18 # 可以指定编译使用的 Golang 版本
  25. binary_name: "chatgpt-dingtalk" # 可以指定二进制文件的名称
  26. extra_files: LICENSE config.example.yml prompt.yml README.md # 需要包含的额外文件