.goreleaser.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. tags: [noserver] # don't include server files
  63. ldflags:
  64. - "-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  65. goos: [windows]
  66. goarch: [amd64]
  67. # No "upx" for Windows to hopefully avoid Virus warnings
  68. -
  69. id: ntfy_darwin_all
  70. binary: ntfy
  71. env:
  72. - CGO_ENABLED=0 # explicitly disable, since we don't need go-sqlite3
  73. tags: [noserver] # don't include server files
  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. name_template: ntfy
  159. checksum:
  160. name_template: 'checksums.txt'
  161. snapshot:
  162. name_template: "{{ .Tag }}-next"
  163. changelog:
  164. sort: asc
  165. filters:
  166. exclude:
  167. - '^docs:'
  168. - '^test:'
  169. dockers:
  170. - image_templates:
  171. - &amd64_image "binwiederhier/ntfy:{{ .Tag }}-amd64"
  172. use: buildx
  173. dockerfile: Dockerfile
  174. goarch: amd64
  175. build_flag_templates:
  176. - "--platform=linux/amd64"
  177. - image_templates:
  178. - &arm64v8_image "binwiederhier/ntfy:{{ .Tag }}-arm64v8"
  179. use: buildx
  180. dockerfile: Dockerfile
  181. goarch: arm64
  182. build_flag_templates:
  183. - "--platform=linux/arm64/v8"
  184. - image_templates:
  185. - &armv7_image "binwiederhier/ntfy:{{ .Tag }}-armv7"
  186. use: buildx
  187. dockerfile: Dockerfile
  188. goarch: arm
  189. goarm: 7
  190. build_flag_templates:
  191. - "--platform=linux/arm/v7"
  192. - image_templates:
  193. - &armv6_image "binwiederhier/ntfy:{{ .Tag }}-armv6"
  194. use: buildx
  195. dockerfile: Dockerfile
  196. goarch: arm
  197. goarm: 6
  198. build_flag_templates:
  199. - "--platform=linux/arm/v6"
  200. docker_manifests:
  201. - name_template: "binwiederhier/ntfy:latest"
  202. image_templates:
  203. - *amd64_image
  204. - *arm64v8_image
  205. - *armv7_image
  206. - *armv6_image
  207. - name_template: "binwiederhier/ntfy:{{ .Tag }}"
  208. image_templates:
  209. - *amd64_image
  210. - *arm64v8_image
  211. - *armv7_image
  212. - *armv6_image