357 lines
10 KiB
YAML
357 lines
10 KiB
YAML
# .goreleaser.yaml
|
|
before:
|
|
hooks:
|
|
- make man
|
|
- make readme
|
|
- make rsrc
|
|
|
|
builds:
|
|
- id: unpoller
|
|
env:
|
|
- CGO_ENABLED=0
|
|
binary: unpoller
|
|
goos:
|
|
- linux
|
|
- freebsd
|
|
goarch:
|
|
- amd64
|
|
- "386"
|
|
ignore:
|
|
- goos: darwin
|
|
goarch: "386"
|
|
- goarm: mips64
|
|
- gomips: hardfloat
|
|
- goamd64: v4
|
|
- goos: freebsd
|
|
goarch: "386"
|
|
- id: unpoller-mac
|
|
env:
|
|
- CGO_ENABLED=0
|
|
binary: unpoller
|
|
goos:
|
|
- darwin
|
|
goarch:
|
|
- amd64
|
|
- arm64
|
|
ignore:
|
|
- goos: darwin
|
|
goarch: "386"
|
|
- id: unpoller-linux-arm
|
|
env:
|
|
- CGO_ENABLED=0
|
|
binary: unpoller
|
|
goarm:
|
|
- "6"
|
|
- "7"
|
|
goos:
|
|
- linux
|
|
goarch:
|
|
- arm64
|
|
- arm
|
|
- id: unpoller-windows
|
|
env:
|
|
- CGO_ENABLED=0
|
|
binary: unpoller
|
|
goos:
|
|
- windows
|
|
goarch:
|
|
- amd64
|
|
|
|
archives:
|
|
- id: unpoller
|
|
builds:
|
|
- unpoller
|
|
files:
|
|
- LICENSE
|
|
- README.md
|
|
- examples/up.*.example
|
|
- id: unpoller-linux-arm
|
|
builds:
|
|
- unpoller-linux-arm
|
|
files:
|
|
- LICENSE
|
|
- README.html
|
|
- unpoller_manual.html
|
|
- examples/up.*.example
|
|
- id: unpoller-mac
|
|
builds:
|
|
- unpoller-mac
|
|
files:
|
|
- LICENSE
|
|
- README.html
|
|
- unpoller_manual.html
|
|
- examples/up.*.example
|
|
- id: unpoller-windows
|
|
format_overrides:
|
|
- goos: windows
|
|
format: zip
|
|
builds:
|
|
- unpoller-windows
|
|
files:
|
|
- LICENSE
|
|
- README.html
|
|
- unpoller_manual.html
|
|
- rsrc_windows_*.syso
|
|
- examples/up.*.example
|
|
- init/windows/application.ico
|
|
|
|
dockers:
|
|
- id: docker-linux-amd64
|
|
ids:
|
|
- unpoller
|
|
goos: linux
|
|
goarch: amd64
|
|
image_templates:
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest-amd64"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}-amd64"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}-amd64"
|
|
use: buildx
|
|
build_flag_templates:
|
|
- "--pull"
|
|
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
|
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
- "--label=org.opencontainers.image.version={{.Version}}"
|
|
- "--label=org.opencontainers.image.documentation='https://unpoller.com/docs/install/docker'"
|
|
- "--label=org.opencontainers.image.description='Telemetry and Observability for your UniFi Network'"
|
|
- "--label=org.opencontainers.image.url='https://unpoller.com'"
|
|
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
|
- "--label=org.opencontainers.image.vendor=unpoller"
|
|
- "--label=org.opencontainers.image.licenses=MIT"
|
|
- "--platform=linux/amd64"
|
|
push_flags:
|
|
- --tls-verify=false
|
|
extra_files:
|
|
- "examples/up.conf.example"
|
|
- "examples/up.json.example"
|
|
- "examples/up.yaml.example"
|
|
- "README.html"
|
|
- "unpoller_manual.html"
|
|
- id: docker-linux-arm64
|
|
ids:
|
|
- unpoller-linux-arm
|
|
goos: linux
|
|
goarch: arm64
|
|
image_templates:
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest-arm64v8"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}-arm64v8"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}-arm64v8"
|
|
use: buildx
|
|
build_flag_templates:
|
|
- "--pull"
|
|
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
|
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
- "--label=org.opencontainers.image.version={{.Version}}"
|
|
- "--label=org.opencontainers.image.documentation='https://unpoller.com/docs/install/docker'"
|
|
- "--label=org.opencontainers.image.description='Telemetry and Observability for your UniFi Network'"
|
|
- "--label=org.opencontainers.image.url='https://unpoller.com'"
|
|
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
|
- "--label=org.opencontainers.image.vendor=unpoller"
|
|
- "--label=org.opencontainers.image.licenses=MIT"
|
|
- "--platform=linux/arm64"
|
|
push_flags:
|
|
- --tls-verify=false
|
|
extra_files:
|
|
- "examples/up.conf.example"
|
|
- "examples/up.json.example"
|
|
- "examples/up.yaml.example"
|
|
- "README.html"
|
|
- "unpoller_manual.html"
|
|
- id: docker-linux-armv7
|
|
ids:
|
|
- unpoller-linux-arm
|
|
goos: linux
|
|
goarch: arm
|
|
goarm: "7"
|
|
image_templates:
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest-armv7"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}-armv7"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}-armv7"
|
|
use: buildx
|
|
build_flag_templates:
|
|
- "--pull"
|
|
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
|
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
- "--label=org.opencontainers.image.version={{.Version}}"
|
|
- "--label=org.opencontainers.image.documentation='https://unpoller.com/docs/install/docker'"
|
|
- "--label=org.opencontainers.image.description='Telemetry and Observability for your UniFi Network'"
|
|
- "--label=org.opencontainers.image.url='https://unpoller.com'"
|
|
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
|
- "--label=org.opencontainers.image.vendor=unpoller"
|
|
- "--label=org.opencontainers.image.licenses=MIT"
|
|
- "--platform=linux/arm/v7"
|
|
push_flags:
|
|
- --tls-verify=false
|
|
extra_files:
|
|
- "examples/up.conf.example"
|
|
- "examples/up.json.example"
|
|
- "examples/up.yaml.example"
|
|
- "README.html"
|
|
- "unpoller_manual.html"
|
|
|
|
docker_manifests:
|
|
- name_template: '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest'
|
|
create_flags:
|
|
- --insecure
|
|
push_flags:
|
|
- --insecure
|
|
image_templates:
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest-amd64"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest-arm64v8"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:latest-armv7"
|
|
- name_template: '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}'
|
|
create_flags:
|
|
- --insecure
|
|
push_flags:
|
|
- --insecure
|
|
image_templates:
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}-amd64"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}-arm64v8"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:{{ .Tag }}-armv7"
|
|
- name_template: '{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}'
|
|
create_flags:
|
|
- --insecure
|
|
push_flags:
|
|
- --insecure
|
|
image_templates:
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}-amd64"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}-arm64v8"
|
|
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_IMAGE_NAME }}:v{{ .Major }}-armv7"
|
|
|
|
nfpms:
|
|
- id: unpoller-packages
|
|
builds:
|
|
- unpoller
|
|
- unpoller-linux-arm
|
|
replacements:
|
|
amd64: 64-bit
|
|
386: 32-bit
|
|
darwin: macOS
|
|
linux: Tux
|
|
|
|
vendor: unpoller
|
|
homepage: https://unpoller.com/
|
|
maintainer: unpoller.com
|
|
description: Telemetry and Observability for your UniFi Network
|
|
license: MIT
|
|
formats:
|
|
- deb
|
|
- rpm
|
|
bindir: /usr/bin
|
|
version_metadata: git
|
|
section: default
|
|
priority: extra
|
|
# provides defines the packages. The first one defines the package name.
|
|
provides:
|
|
- unpoller
|
|
- unifi-poller
|
|
|
|
# Contents to add to the package.
|
|
# GoReleaser will automatically add the binaries.
|
|
contents:
|
|
- dst: /etc/unpoller
|
|
type: dir
|
|
file_info:
|
|
mode: 0740
|
|
- dst: /usr/share/doc/unpoller
|
|
type: dir
|
|
file_info:
|
|
mode: 0755
|
|
|
|
# Example config files
|
|
- src: examples/up.conf.example
|
|
dst: /etc/unpoller/up.conf.example
|
|
type: config
|
|
- src: examples/up.json.example
|
|
dst: /etc/unpoller/up.json.example
|
|
type: config
|
|
- src: examples/up.yaml.example
|
|
dst: /etc/unpoller/up.yaml.example
|
|
type: config
|
|
- src: "README.html"
|
|
dst: /etc/unpoller/readme.html
|
|
type: config
|
|
- src: "unpoller_manual.html"
|
|
dst: /etc/unpoller/manual.html
|
|
type: config
|
|
|
|
# man pages
|
|
- src: unpoller.1.gz
|
|
dst: /usr/share/man/man1/unpoller.1.gz
|
|
type: man
|
|
- src: LICENSE
|
|
dst: /usr/share/doc/unpoller/LICENSE
|
|
type: man
|
|
- src: unpoller_manual.html
|
|
dst: /usr/share/doc/unpoller/unpoller_manual.html
|
|
type: man
|
|
|
|
# systemd service
|
|
- src: init/systemd/unpoller.service
|
|
dst: /lib/systemd/service/unpoller.service
|
|
type: config
|
|
|
|
# freebsd rc service
|
|
- src: init/bsd/freebsd.rc.d
|
|
dst: /usr/local/etc/rc.d/unpoller
|
|
type: config
|
|
|
|
# web server statics
|
|
- dst: /usr/local/lib/unpoller/web/static/
|
|
type: dir
|
|
file_info:
|
|
mode: 0755
|
|
- dst: /usr/local/lib/unpoller/web/static/css
|
|
type: dir
|
|
file_info:
|
|
mode: 0755
|
|
- dst: /usr/local/lib/unpoller/web/static/images
|
|
type: dir
|
|
file_info:
|
|
mode: 0755
|
|
- dst: /usr/local/lib/unpoller/web/static/js
|
|
type: dir
|
|
file_info:
|
|
mode: 0755
|
|
- src: init/webserver/index.html
|
|
dst: /usr/local/lib/unpoller/web/static/index.html
|
|
type: config
|
|
- src: init/webserver/static/css/*
|
|
dst: /usr/local/lib/unpoller/web/static//css
|
|
type: config
|
|
- src: init/webserver/static/images/*
|
|
dst: /usr/local/lib/unpoller/web/static/images
|
|
type: config
|
|
- src: init/webserver/static/js/*
|
|
dst: /usr/local/lib/unpoller/web/static/js
|
|
type: config
|
|
|
|
|
|
# signing
|
|
scripts:
|
|
postinstall: "scripts/after-install.sh"
|
|
preremove: "scripts/before-remove.sh"
|
|
|
|
signs:
|
|
- id: default
|
|
artifacts: all
|
|
ids:
|
|
- unpoller
|
|
- unpoller-linux-arm
|
|
- unpoller-windows
|
|
- unpoller-mac
|
|
|
|
universal_binaries:
|
|
- replace: true
|
|
ids:
|
|
- unpoller-mac
|
|
|
|
publishers:
|
|
- name: "packagecloud-publisher"
|
|
ids:
|
|
- unpoller-packages
|
|
cmd: "scripts/packagecloud_push.sh '{{ .Tag }}' '{{ .Env.PACKAGECLOUD_TOKEN }}' 'unpoller' '{{ .ArtifactPath }}' '{{ .Os }}'"
|
|
|