.goreleaser.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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_utls
  20. - with_acme
  21. - with_clash_api
  22. - with_tailscale
  23. env:
  24. - CGO_ENABLED=0
  25. - GOTOOLCHAIN=local
  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_acme
  50. - with_clash_api
  51. - with_tailscale
  52. env:
  53. - CGO_ENABLED=0
  54. - GOROOT={{ .Env.GOPATH }}/go_legacy
  55. tool: "{{ .Env.GOPATH }}/go_legacy/bin/go"
  56. targets:
  57. - windows_amd64_v1
  58. - windows_386
  59. - id: android
  60. <<: *template
  61. env:
  62. - CGO_ENABLED=1
  63. - GOTOOLCHAIN=local
  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. formats:
  99. - tar.gz
  100. format_overrides:
  101. - goos: windows
  102. formats:
  103. - zip
  104. wrap_in_directory: true
  105. files:
  106. - LICENSE
  107. 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 }}'
  108. - id: archive-legacy
  109. <<: *template
  110. builds:
  111. - legacy
  112. name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}-legacy'
  113. nfpms:
  114. - id: package
  115. package_name: sing-box
  116. 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 }}'
  117. builds:
  118. - main
  119. homepage: https://sing-box.sagernet.org/
  120. maintainer: nekohasekai <[email protected]>
  121. description: The universal proxy platform.
  122. license: GPLv3 or later
  123. formats:
  124. - deb
  125. - rpm
  126. - archlinux
  127. # - apk
  128. # - ipk
  129. priority: extra
  130. contents:
  131. - src: release/config/config.json
  132. dst: /etc/sing-box/config.json
  133. type: "config|noreplace"
  134. - src: release/config/sing-box.service
  135. dst: /usr/lib/systemd/system/sing-box.service
  136. - src: release/config/[email protected]
  137. dst: /usr/lib/systemd/system/[email protected]
  138. - src: release/config/sing-box.sysusers
  139. dst: /usr/lib/sysusers.d/sing-box.conf
  140. - src: release/config/sing-box.rules
  141. dst: /usr/share/polkit-1/rules.d/sing-box.rules
  142. - src: release/config/sing-box-split-dns.xml
  143. dst: /usr/share/dbus-1/system.d/sing-box-split-dns.conf
  144. - src: release/completions/sing-box.bash
  145. dst: /usr/share/bash-completion/completions/sing-box.bash
  146. - src: release/completions/sing-box.fish
  147. dst: /usr/share/fish/vendor_completions.d/sing-box.fish
  148. - src: release/completions/sing-box.zsh
  149. dst: /usr/share/zsh/site-functions/_sing-box
  150. - src: LICENSE
  151. dst: /usr/share/licenses/sing-box/LICENSE
  152. deb:
  153. signature:
  154. key_file: "{{ .Env.NFPM_KEY_PATH }}"
  155. fields:
  156. Bugs: https://github.com/SagerNet/sing-box/issues
  157. rpm:
  158. signature:
  159. key_file: "{{ .Env.NFPM_KEY_PATH }}"
  160. overrides:
  161. apk:
  162. contents:
  163. - src: release/config/config.json
  164. dst: /etc/sing-box/config.json
  165. type: config
  166. - src: release/config/sing-box.initd
  167. dst: /etc/init.d/sing-box
  168. - src: release/completions/sing-box.bash
  169. dst: /usr/share/bash-completion/completions/sing-box.bash
  170. - src: release/completions/sing-box.fish
  171. dst: /usr/share/fish/vendor_completions.d/sing-box.fish
  172. - src: release/completions/sing-box.zsh
  173. dst: /usr/share/zsh/site-functions/_sing-box
  174. - src: LICENSE
  175. dst: /usr/share/licenses/sing-box/LICENSE
  176. ipk:
  177. contents:
  178. - src: release/config/config.json
  179. dst: /etc/sing-box/config.json
  180. type: config
  181. - src: release/config/openwrt.init
  182. dst: /etc/init.d/sing-box
  183. - src: release/config/openwrt.conf
  184. dst: /etc/config/sing-box
  185. source:
  186. enabled: false
  187. name_template: '{{ .ProjectName }}-{{ .Version }}.source'
  188. prefix_template: '{{ .ProjectName }}-{{ .Version }}/'
  189. checksum:
  190. disable: true
  191. name_template: '{{ .ProjectName }}-{{ .Version }}.checksum'
  192. signs:
  193. - artifacts: checksum
  194. release:
  195. github:
  196. owner: SagerNet
  197. name: sing-box
  198. draft: true
  199. prerelease: auto
  200. mode: replace
  201. ids:
  202. - archive
  203. - package
  204. skip_upload: true
  205. partial:
  206. by: target