.goreleaser.yml 3.7 KB

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