.goreleaser.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. before:
  2. hooks:
  3. - go mod download
  4. - go mod tidy
  5. builds:
  6. -
  7. id: ntfy_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_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", since it causes random core dumps, see
  32. # https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546
  33. -
  34. id: ntfy_armv7
  35. binary: ntfy
  36. env:
  37. - CGO_ENABLED=1 # required for go-sqlite3
  38. - CC=arm-linux-gnueabi-gcc # apt install gcc-arm-linux-gnueabi
  39. tags: [sqlite_omit_load_extension,osusergo,netgo]
  40. ldflags:
  41. - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  42. goos: [linux]
  43. goarch: [arm]
  44. goarm: [7]
  45. # No "upx", since it causes random core dumps, see
  46. # https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546
  47. -
  48. id: ntfy_arm64
  49. binary: ntfy
  50. env:
  51. - CGO_ENABLED=1 # required for go-sqlite3
  52. - CC=aarch64-linux-gnu-gcc # apt install gcc-aarch64-linux-gnu
  53. tags: [sqlite_omit_load_extension,osusergo,netgo]
  54. ldflags:
  55. - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
  56. goos: [linux]
  57. goarch: [arm64]
  58. # No "upx", since it causes random core dumps, see
  59. # https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546
  60. nfpms:
  61. -
  62. package_name: ntfy
  63. homepage: https://heckel.io/ntfy
  64. maintainer: Philipp C. Heckel <philipp.heckel@gmail.com>
  65. description: Simple pub-sub notification service
  66. license: Apache 2.0
  67. formats:
  68. - deb
  69. - rpm
  70. bindir: /usr/bin
  71. contents:
  72. - src: server/server.yml
  73. dst: /etc/ntfy/server.yml
  74. type: "config|noreplace"
  75. - src: server/ntfy.service
  76. dst: /lib/systemd/system/ntfy.service
  77. - src: client/client.yml
  78. dst: /etc/ntfy/client.yml
  79. type: "config|noreplace"
  80. - src: client/ntfy-client.service
  81. dst: /lib/systemd/system/ntfy-client.service
  82. - dst: /var/cache/ntfy
  83. type: dir
  84. - dst: /var/cache/ntfy/attachments
  85. type: dir
  86. - dst: /var/lib/ntfy
  87. type: dir
  88. - dst: /usr/share/ntfy/logo.png
  89. src: web/public/static/img/ntfy.png
  90. scripts:
  91. preinstall: "scripts/preinst.sh"
  92. postinstall: "scripts/postinst.sh"
  93. preremove: "scripts/prerm.sh"
  94. postremove: "scripts/postrm.sh"
  95. archives:
  96. -
  97. wrap_in_directory: true
  98. files:
  99. - LICENSE
  100. - README.md
  101. - server/server.yml
  102. - server/ntfy.service
  103. - client/client.yml
  104. - client/ntfy-client.service
  105. replacements:
  106. 386: i386
  107. amd64: x86_64
  108. checksum:
  109. name_template: 'checksums.txt'
  110. snapshot:
  111. name_template: "{{ .Tag }}-next"
  112. changelog:
  113. sort: asc
  114. filters:
  115. exclude:
  116. - '^docs:'
  117. - '^test:'
  118. dockers:
  119. - image_templates:
  120. - &amd64_image "binwiederhier/ntfy:{{ .Tag }}-amd64"
  121. use: buildx
  122. dockerfile: Dockerfile
  123. goarch: amd64
  124. build_flag_templates:
  125. - "--platform=linux/amd64"
  126. - image_templates:
  127. - &arm64v8_image "binwiederhier/ntfy:{{ .Tag }}-arm64v8"
  128. use: buildx
  129. dockerfile: Dockerfile
  130. goarch: arm64
  131. build_flag_templates:
  132. - "--platform=linux/arm64/v8"
  133. - image_templates:
  134. - &armv7_image "binwiederhier/ntfy:{{ .Tag }}-armv7"
  135. use: buildx
  136. dockerfile: Dockerfile
  137. goarch: arm
  138. goarm: 7
  139. build_flag_templates:
  140. - "--platform=linux/arm/v7"
  141. - image_templates:
  142. - &armv6_image "binwiederhier/ntfy:{{ .Tag }}-armv6"
  143. use: buildx
  144. dockerfile: Dockerfile
  145. goarch: arm
  146. goarm: 6
  147. build_flag_templates:
  148. - "--platform=linux/arm/v6"
  149. docker_manifests:
  150. - name_template: "binwiederhier/ntfy:latest"
  151. image_templates:
  152. - *amd64_image
  153. - *arm64v8_image
  154. - *armv7_image
  155. - *armv6_image
  156. - name_template: "binwiederhier/ntfy:{{ .Tag }}"
  157. image_templates:
  158. - *amd64_image
  159. - *arm64v8_image
  160. - *armv7_image
  161. - *armv6_image