-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
127 lines (118 loc) · 3.73 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
version: 2
# Before building anything, we need to ensure that go modules and generators are set up correctly
before:
hooks:
- go mod tidy
- go generate ./...
# These are the final binaries, that we want to create
builds:
# This first linux build also contains the defaults used for all other platforms
- <<: &build_defaults
binary: tuwat
# The single main entrypoint binary for tuwat
main: ./cmd/tuwat
env:
# We have no C dependencies
- CGO_ENABLED=0
# We want our builds to be reproducible, so we use the commit time as timestamps
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w
- -X {{.ModulePath}}/pkg/version.application={{.Binary}}
- -X {{.ModulePath}}/pkg/version.version={{.Version}}
- -X {{.ModulePath}}/pkg/version.revision={{.FullCommit}}
- -X {{.ModulePath}}/pkg/version.branch={{.Branch}}
- -X {{.ModulePath}}/pkg/version.releaseDate={{.Date}}
id: linux
goos:
- linux
goarch:
- amd64
- arm64
- <<: *build_defaults
id: darwin
goos:
- darwin
goarch:
- amd64
- arm64
# For systems supporting universal binaries (hello Apple!) we ship a single binary
universal_binaries:
- id: darwin
ids:
- darwin
replace: true
# Configure how snapshots are versioned
snapshot:
version_template: '{{ incpatch .Version }}-dev-{{ .ShortCommit }}'
# Configure what goes into the archives
archives:
- <<:
name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
# Additonally packaged files
files:
- LICENSE
- README*
- CHANGELOG*
- config.example.toml
id: nix
builds: [ linux, darwin ]
format: tar.gz
dockers:
- image_templates:
- "synyx/tuwat:{{ .Version }}-amd64"
use: buildx
goos: linux
goarch: amd64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/amd64"
- image_templates:
- "synyx/tuwat:{{ .Version }}-arm64"
use: buildx
goos: linux
goarch: arm64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/arm64"
docker_manifests:
- name_template: 'synyx/tuwat:{{ .Version }}'
image_templates:
- 'synyx/tuwat:{{ .Version }}-amd64'
- 'synyx/tuwat:{{ .Version }}-arm64'
# We also move the latest when publishing new images
- name_template: 'synyx/tuwat:latest'
image_templates:
- 'synyx/tuwat:{{ .Version }}-amd64'
- 'synyx/tuwat:{{ .Version }}-arm64'
nfpms:
- file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}'
homepage: https://github.com/synyx/tuwat
description: |-
Simple, 0-dependencies, dashboard for Nagios/Alertmanager/GitLab...
maintainer: Jonathan Buch <[email protected]>
license: BSD
vendor: synyx
formats:
- deb
- rpm
bindir: /usr/bin
section: utils
contents:
- src: ./LICENSE
dst: /usr/share/doc/tuwat/copyright
file_info:
mode: 0644
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj