.goreleaser.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. version: 2
  2. project_name: sing-box
  3. builds:
  4. - &template
  5. id: main
  6. main: ./cmd/sing-box
  7. flags:
  8. - -v
  9. - -trimpath
  10. ldflags:
  11. - -X github.com/sagernet/sing-box/constant.Version={{ .Version }}
  12. - -s
  13. - -buildid=
  14. tags:
  15. - with_gvisor
  16. - with_quic
  17. - with_dhcp
  18. - with_wireguard
  19. - with_ech
  20. - with_utls
  21. - with_reality_server
  22. - with_acme
  23. - with_clash_api
  24. env:
  25. - CGO_ENABLED=0
  26. targets:
  27. - linux_386
  28. - linux_amd64_v1
  29. - linux_arm64
  30. - linux_arm_6
  31. - linux_arm_7
  32. - linux_s390x
  33. - linux_riscv64
  34. - linux_mips64le
  35. - windows_amd64_v1
  36. - windows_386
  37. - windows_arm64
  38. - darwin_amd64_v1
  39. - darwin_arm64
  40. mod_timestamp: '{{ .CommitTimestamp }}'
  41. - id: legacy
  42. <<: *template
  43. tags:
  44. - with_gvisor
  45. - with_quic
  46. - with_dhcp
  47. - with_wireguard
  48. - with_utls
  49. - with_reality_server
  50. - with_acme
  51. - with_clash_api
  52. env:
  53. - CGO_ENABLED=0
  54. - GOROOT={{ .Env.GOPATH }}/go1.20.14
  55. gobinary: "{{ .Env.GOPATH }}/go1.20.14/bin/go"
  56. targets:
  57. - windows_amd64_v1
  58. - windows_386
  59. - darwin_amd64_v1
  60. - id: android
  61. <<: *template
  62. env:
  63. - CGO_ENABLED=1
  64. overrides:
  65. - goos: android
  66. goarch: arm
  67. goarm: 7
  68. env:
  69. - CC=armv7a-linux-androideabi21-clang
  70. - CXX=armv7a-linux-androideabi21-clang++
  71. - goos: android
  72. goarch: arm64
  73. env:
  74. - CC=aarch64-linux-android21-clang
  75. - CXX=aarch64-linux-android21-clang++
  76. - goos: android
  77. goarch: 386
  78. env:
  79. - CC=i686-linux-android21-clang
  80. - CXX=i686-linux-android21-clang++
  81. - goos: android
  82. goarch: amd64
  83. goamd64: v1
  84. env:
  85. - CC=x86_64-linux-android21-clang
  86. - CXX=x86_64-linux-android21-clang++
  87. targets:
  88. - android_arm_7
  89. - android_arm64
  90. - android_386
  91. - android_amd64
  92. archives:
  93. - &template
  94. id: archive
  95. builds:
  96. - main
  97. - android
  98. format: tar.gz
  99. format_overrides:
  100. - goos: windows
  101. format: zip
  102. wrap_in_directory: true
  103. files:
  104. - LICENSE
  105. name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if and .Mips (not (eq .Mips "hardfloat")) }}_{{ .Mips }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
  106. - id: archive-legacy
  107. <<: *template
  108. builds:
  109. - legacy
  110. name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}-legacy'
  111. nfpms:
  112. - id: package
  113. package_name: sing-box
  114. file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if and .Mips (not (eq .Mips "hardfloat")) }}_{{ .Mips }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
  115. builds:
  116. - main
  117. homepage: https://sing-box.sagernet.org/
  118. maintainer: nekohasekai <[email protected]>
  119. description: The universal proxy platform.
  120. license: GPLv3 or later
  121. formats:
  122. - deb
  123. - rpm
  124. - archlinux
  125. # - apk
  126. # - ipk
  127. priority: extra
  128. contents:
  129. - src: release/config/config.json
  130. dst: /etc/sing-box/config.json
  131. type: config
  132. - src: release/config/sing-box.service
  133. dst: /usr/lib/systemd/system/sing-box.service
  134. - src: release/config/[email protected]
  135. dst: /usr/lib/systemd/system/[email protected]
  136. - src: release/completions/sing-box.bash
  137. dst: /usr/share/bash-completion/completions/sing-box.bash
  138. - src: release/completions/sing-box.fish
  139. dst: /usr/share/fish/vendor_completions.d/sing-box.fish
  140. - src: release/completions/sing-box.zsh
  141. dst: /usr/share/zsh/site-functions/_sing-box
  142. - src: LICENSE
  143. dst: /usr/share/licenses/sing-box/LICENSE
  144. deb:
  145. signature:
  146. key_file: "{{ .Env.NFPM_KEY_PATH }}"
  147. fields:
  148. Bugs: https://github.com/SagerNet/sing-box/issues
  149. rpm:
  150. signature:
  151. key_file: "{{ .Env.NFPM_KEY_PATH }}"
  152. overrides:
  153. apk:
  154. contents:
  155. - src: release/config/config.json
  156. dst: /etc/sing-box/config.json
  157. type: config
  158. - src: release/config/sing-box.initd
  159. dst: /etc/init.d/sing-box
  160. - src: release/completions/sing-box.bash
  161. dst: /usr/share/bash-completion/completions/sing-box.bash
  162. - src: release/completions/sing-box.fish
  163. dst: /usr/share/fish/vendor_completions.d/sing-box.fish
  164. - src: release/completions/sing-box.zsh
  165. dst: /usr/share/zsh/site-functions/_sing-box
  166. - src: LICENSE
  167. dst: /usr/share/licenses/sing-box/LICENSE
  168. ipk:
  169. contents:
  170. - src: release/config/config.json
  171. dst: /etc/sing-box/config.json
  172. type: config
  173. - src: release/config/openwrt.init
  174. dst: /etc/init.d/sing-box
  175. - src: release/config/openwrt.conf
  176. dst: /etc/config/sing-box
  177. source:
  178. enabled: false
  179. name_template: '{{ .ProjectName }}-{{ .Version }}.source'
  180. prefix_template: '{{ .ProjectName }}-{{ .Version }}/'
  181. checksum:
  182. disable: true
  183. name_template: '{{ .ProjectName }}-{{ .Version }}.checksum'
  184. signs:
  185. - artifacts: checksum
  186. release:
  187. github:
  188. owner: SagerNet
  189. name: sing-box
  190. draft: true
  191. prerelease: auto
  192. mode: replace
  193. ids:
  194. - archive
  195. - package
  196. skip_upload: true
  197. partial:
  198. by: target