.goreleaser.simple.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # 简化版 GoReleaser 配置 - 仅发布 x86_64 GHCR 镜像
  2. version: 2
  3. project_name: sub2api
  4. before:
  5. hooks:
  6. - go mod tidy -C backend
  7. builds:
  8. - id: sub2api
  9. dir: backend
  10. main: ./cmd/server
  11. binary: sub2api
  12. flags:
  13. - -tags=embed
  14. env:
  15. - CGO_ENABLED=0
  16. goos:
  17. - linux
  18. goarch:
  19. - amd64
  20. ldflags:
  21. - -s -w
  22. - -X main.Commit={{.Commit}}
  23. - -X main.Date={{.Date}}
  24. - -X main.BuildType=release
  25. # 跳过 archives
  26. archives: []
  27. # 跳过 checksum
  28. checksum:
  29. disable: true
  30. changelog:
  31. disable: true
  32. # 仅 GHCR x86_64 镜像
  33. dockers:
  34. - id: ghcr-amd64
  35. goos: linux
  36. goarch: amd64
  37. image_templates:
  38. - "ghcr.io/{{ .Env.GITHUB_REPO_OWNER_LOWER }}/sub2api:{{ .Version }}-amd64"
  39. - "ghcr.io/{{ .Env.GITHUB_REPO_OWNER_LOWER }}/sub2api:{{ .Version }}"
  40. - "ghcr.io/{{ .Env.GITHUB_REPO_OWNER_LOWER }}/sub2api:latest"
  41. dockerfile: Dockerfile.goreleaser
  42. use: buildx
  43. extra_files:
  44. - deploy/docker-entrypoint.sh
  45. - backend/resources
  46. build_flag_templates:
  47. - "--platform=linux/amd64"
  48. - "--label=org.opencontainers.image.version={{ .Version }}"
  49. - "--label=org.opencontainers.image.revision={{ .Commit }}"
  50. - "--label=org.opencontainers.image.source=https://github.com/{{ .Env.GITHUB_REPO_OWNER }}/{{ .Env.GITHUB_REPO_NAME }}"
  51. # 跳过 manifests(单架构不需要)
  52. docker_manifests: []
  53. release:
  54. github:
  55. owner: "{{ .Env.GITHUB_REPO_OWNER }}"
  56. name: "{{ .Env.GITHUB_REPO_NAME }}"
  57. draft: false
  58. prerelease: auto
  59. name_template: "Sub2API {{.Version}} (Simple)"
  60. # 跳过上传二进制包
  61. skip_upload: true
  62. header: |
  63. > AI API Gateway Platform - 将 AI 订阅配额分发和管理
  64. > ⚡ Simple Release: 仅包含 x86_64 GHCR 镜像
  65. {{ .Env.TAG_MESSAGE }}
  66. footer: |
  67. ---
  68. ## 📥 Installation
  69. **Docker (x86_64 only):**
  70. ```bash
  71. docker pull ghcr.io/{{ .Env.GITHUB_REPO_OWNER_LOWER }}/sub2api:{{ .Version }}
  72. ```
  73. ## 📚 Documentation
  74. - [GitHub Repository](https://github.com/{{ .Env.GITHUB_REPO_OWNER }}/{{ .Env.GITHUB_REPO_NAME }})