.goreleaser.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. before:
  2. hooks:
  3. - go mod download
  4. - go mod tidy
  5. builds:
  6. -
  7. id: ntfy_linux_amd64
  8. binary: ntfy
  9. env:
  10. - CGO_ENABLED=1 # required for go-sqlite3
  11. tags: [sqlite_omit_load_extension,osusergo,netgo]
  12. ldflags:
  13. - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  14. goos: [linux]
  15. goarch: [amd64]
  16. hooks:
  17. post:
  18. - upx "{{ .Path }}" # apt install upx
  19. -
  20. id: ntfy_linux_armv6
  21. binary: ntfy
  22. env:
  23. - CGO_ENABLED=1 # required for go-sqlite3
  24. - CC=arm-linux-gnueabi-gcc # apt install gcc-arm-linux-gnueabi
  25. tags: [sqlite_omit_load_extension,osusergo,netgo]
  26. ldflags:
  27. - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  28. goos: [linux]
  29. goarch: [arm]
  30. goarm: [6]
  31. # No "upx" for ARM, see https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546
  32. -
  33. id: ntfy_linux_armv7
  34. binary: ntfy
  35. env:
  36. - CGO_ENABLED=1 # required for go-sqlite3
  37. - CC=arm-linux-gnueabi-gcc # apt install gcc-arm-linux-gnueabi
  38. tags: [sqlite_omit_load_extension,osusergo,netgo]
  39. ldflags:
  40. - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  41. goos: [linux]
  42. goarch: [arm]
  43. goarm: [7]
  44. # No "upx" for ARM, see https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546
  45. -
  46. id: ntfy_linux_arm64
  47. binary: ntfy
  48. env:
  49. - CGO_ENABLED=1 # required for go-sqlite3
  50. - CC=aarch64-linux-gnu-gcc # apt install gcc-aarch64-linux-gnu
  51. tags: [sqlite_omit_load_extension,osusergo,netgo]
  52. ldflags:
  53. - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  54. goos: [linux]
  55. goarch: [arm64]
  56. # No "upx" for ARM, see https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546
  57. -
  58. id: ntfy_windows_amd64
  59. binary: ntfy
  60. env:
  61. - CGO_ENABLED=0 # explicitly disable, since we don't need go-sqlite3
  62. ldflags:
  63. - "-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  64. goos: [windows]
  65. goarch: [amd64]
  66. hooks:
  67. post:
  68. - upx "{{ .Path }}" # apt install upx
  69. -
  70. id: ntfy_darwin_all
  71. binary: ntfy
  72. env:
  73. - CGO_ENABLED=0 # explicitly disable, since we don't need go-sqlite3
  74. ldflags:
  75. - "-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  76. goos: [darwin]
  77. goarch: [amd64, arm64] # will be combined to "universal binary" (see below)
  78. nfpms:
  79. -
  80. package_name: ntfy
  81. homepage: https://heckel.io/ntfy
  82. maintainer: Philipp C. Heckel <philipp.heckel@gmail.com>
  83. description: Simple pub-sub notification service
  84. license: Apache 2.0
  85. formats:
  86. - deb
  87. - rpm
  88. bindir: /usr/bin
  89. contents:
  90. - src: server/server.yml
  91. dst: /etc/ntfy/server.yml
  92. type: "config|noreplace"
  93. - src: server/ntfy.service
  94. dst: /lib/systemd/system/ntfy.service
  95. - src: client/client.yml
  96. dst: /etc/ntfy/client.yml
  97. type: "config|noreplace"
  98. - src: client/ntfy-client.service
  99. dst: /lib/systemd/system/ntfy-client.service
  100. - dst: /var/cache/ntfy
  101. type: dir
  102. - dst: /var/cache/ntfy/attachments
  103. type: dir
  104. - dst: /var/lib/ntfy
  105. type: dir
  106. - dst: /usr/share/ntfy/logo.png
  107. src: web/public/static/img/ntfy.png
  108. scripts:
  109. preinstall: "scripts/preinst.sh"
  110. postinstall: "scripts/postinst.sh"
  111. preremove: "scripts/prerm.sh"
  112. postremove: "scripts/postrm.sh"
  113. archives:
  114. -
  115. id: ntfy_linux
  116. builds:
  117. - ntfy_linux_amd64
  118. - ntfy_linux_armv6
  119. - ntfy_linux_armv7
  120. - ntfy_linux_arm64
  121. wrap_in_directory: true
  122. files:
  123. - LICENSE
  124. - README.md
  125. - server/server.yml
  126. - server/ntfy.service
  127. - client/client.yml
  128. - client/ntfy-client.service
  129. replacements:
  130. amd64: x86_64
  131. -
  132. id: ntfy_windows
  133. builds:
  134. - ntfy_windows_amd64
  135. format: zip
  136. wrap_in_directory: true
  137. files:
  138. - LICENSE
  139. - README.md
  140. - client/client.yml
  141. replacements:
  142. amd64: x86_64
  143. -
  144. id: ntfy_darwin
  145. builds:
  146. - ntfy_darwin_all
  147. wrap_in_directory: true
  148. files:
  149. - LICENSE
  150. - README.md
  151. - client/client.yml
  152. replacements:
  153. darwin: macOS
  154. universal_binaries:
  155. -
  156. id: ntfy_darwin_all
  157. replace: true
  158. checksum:
  159. name_template: 'checksums.txt'
  160. snapshot:
  161. name_template: "{{ .Tag }}-next"
  162. changelog:
  163. sort: asc
  164. filters:
  165. exclude:
  166. - '^docs:'
  167. - '^test:'
  168. dockers:
  169. - image_templates:
  170. - &amd64_image "binwiederhier/ntfy:{{ .Tag }}-amd64"
  171. use: buildx
  172. dockerfile: Dockerfile
  173. goarch: amd64
  174. build_flag_templates:
  175. - "--platform=linux/amd64"
  176. - image_templates:
  177. - &arm64v8_image "binwiederhier/ntfy:{{ .Tag }}-arm64v8"
  178. use: buildx
  179. dockerfile: Dockerfile
  180. goarch: arm64
  181. build_flag_templates:
  182. - "--platform=linux/arm64/v8"
  183. - image_templates:
  184. - &armv7_image "binwiederhier/ntfy:{{ .Tag }}-armv7"
  185. use: buildx
  186. dockerfile: Dockerfile
  187. goarch: arm
  188. goarm: 7
  189. build_flag_templates:
  190. - "--platform=linux/arm/v7"
  191. - image_templates:
  192. - &armv6_image "binwiederhier/ntfy:{{ .Tag }}-armv6"
  193. use: buildx
  194. dockerfile: Dockerfile
  195. goarch: arm
  196. goarm: 6
  197. build_flag_templates:
  198. - "--platform=linux/arm/v6"
  199. docker_manifests:
  200. - name_template: "binwiederhier/ntfy:latest"
  201. image_templates:
  202. - *amd64_image
  203. - *arm64v8_image
  204. - *armv7_image
  205. - *armv6_image
  206. - name_template: "binwiederhier/ntfy:{{ .Tag }}"
  207. image_templates:
  208. - *amd64_image
  209. - *arm64v8_image
  210. - *armv7_image
  211. - *armv6_image