-
Notifications
You must be signed in to change notification settings - Fork 2
/
.goreleaser.yaml
106 lines (106 loc) · 3.6 KB
/
.goreleaser.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
- go mod tidy
- go test -v ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ldflags:
- -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.BuildDate={{ .CommitDate }}
main: ./cmd/main.go
archives:
- name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else if eq .Arch "darwin" }}Darwin
{{- else if eq .Arch "linux" }}Linux
{{- else if eq .Arch "windows" }}Windows
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
# build latest and specific tag version images
# https://goreleaser.com/cookbooks/multi-platform-docker-images/#other-things-to-pay-attention-to
- image_templates:
- "ghcr.io/linode-obs/{{.ProjectName}}:{{ .Tag }}"
- "ghcr.io/linode-obs/{{.ProjectName}}:{{ .Tag }}-amd64"
- "ghcr.io/linode-obs/{{.ProjectName}}:latest" # keep latest as linux/amd64
use: buildx
goos: linux
goarch: amd64
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.source=https://github.com/linode-obs/ping_exporter"
- "--label=org.opencontainers.image.description='Yet another prometheus ping exporter'"
- "--label=org.opencontainers.image.licenses=MIT"
- "--platform=linux/amd64"
dockerfile: "Dockerfile_goreleaser"
- image_templates:
- "ghcr.io/linode-obs/{{.ProjectName}}:{{ .Tag }}-linux-arm64"
use: buildx
goos: linux
goarch: arm64
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.source=https://github.com/linode-obs/ping_exporter"
- "--label=org.opencontainers.image.description='Yet another prometheus ping exporter'"
- "--label=org.opencontainers.image.licenses=MIT"
- "--platform=linux/arm64"
dockerfile: "Dockerfile_goreleaser"
nfpms:
- id: default
formats:
- deb
- rpm
package_name: "prometheus-ping-exporter"
section: "default"
priority: "extra"
replaces: []
dependencies: []
recommends: []
suggests: []
conflicts: []
maintainer: "Will Bollock <wbollock@gmail.com>"
description: |
Yet another prometheus ping exporter with support
for the multi-target export pattern.
homepage: "https://github.com/linode-obs/ping_exporter"
license: "MIT"
contents:
# provided by goreleaser
- src: ./dist/ping_exporter_linux_amd64_v1/ping_exporter
dst: /usr/local/bin/prometheus-ping-exporter
- src: ./nfpm/systemd/prometheus-ping-exporter.service
dst: /etc/systemd/system/prometheus-ping-exporter.service
type: config
- src: ./nfpm/etc/default/prometheus-ping-exporter
dst: /etc/default/prometheus-ping-exporter
type: config
scripts:
postinstall: ./nfpm/scripts/postinstall.sh