generated from d2iq-archive/golang-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.goreleaser.yml
207 lines (198 loc) · 5.86 KB
/
.goreleaser.yml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Copyright 2021 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
version: 2
project_name: mindthegap
changelog:
use: github
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
filters:
exclude:
- '^docs:'
- '^chore:'
- '^build:'
release:
footer: |
### Summary
**Full Changelog**: https://github.com/mesosphere/mindthegap/compare/{{ .PreviousTag }}...{{ .Tag }}
builds:
- id: mindthegap
main: ./cmd/mindthegap
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s
- -w
- -X 'github.com/mesosphere/dkp-cli-runtime/core/cmd/version.commitDate={{ .CommitDate }}'
- -X 'github.com/mesosphere/dkp-cli-runtime/core/cmd/version.gitCommit={{ .FullCommit }}'
- -X 'github.com/mesosphere/dkp-cli-runtime/core/cmd/version.gitTreeState={{ .Env.GIT_TREE_STATE }}'
- -X 'github.com/mesosphere/dkp-cli-runtime/core/cmd/version.gitVersion=v{{ trimprefix .Version "v" }}'
- -X 'github.com/mesosphere/dkp-cli-runtime/core/cmd/version.major={{ .Major }}'
- -X 'github.com/mesosphere/dkp-cli-runtime/core/cmd/version.minor={{ .Minor }}'
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
post:
- |
sh -ec 'if [ {{ .IsSnapshot }} == true ] && [ {{ .Runtime.Goarch }} == {{ .Arch }} ]; then
env SOURCE_DATE_EPOCH=$(date +%s) \
KO_DATA_DATE_EPOCH=$(date +%s) \
KO_DOCKER_REPO=ko.local/mindthegap \
ko build \
--bare \
--platform linux/{{ .Arch }} \
-t v{{ trimprefix .Version "v" }}-{{ .Arch }} \
./cmd/mindthegap
fi'
- id: wait-for-file-to-exist
dir: ./cmd/wait-for-file-to-exist
binary: wait-for-file-to-exist
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s
- -w
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
post:
- |
sh -ec 'if [ {{ .IsSnapshot }} == true ] && [ {{ .Runtime.Goarch }} == {{ .Arch }} ]; then
cd ./cmd/wait-for-file-to-exist && \
env SOURCE_DATE_EPOCH=$(date +%s) \
KO_DATA_DATE_EPOCH=$(date +%s) \
KO_DOCKER_REPO=ko.local/wait-for-file-to-exist \
KO_DEFAULTBASEIMAGE=cgr.dev/chainguard/busybox \
ko build \
--bare \
--platform linux/{{ .Arch }} \
-t v{{ trimprefix .Version "v" }}-{{ .Arch }} \
.
fi'
- id: copy-file-to-pod
dir: ./cmd/copy-file-to-pod
binary: copy-file-to-pod
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s
- -w
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
post:
- |
sh -ec 'if [ {{ .IsSnapshot }} == true ] && [ {{ .Runtime.Goarch }} == {{ .Arch }} ]; then
cd ./cmd/copy-file-to-pod && \
env SOURCE_DATE_EPOCH=$(date +%s) \
KO_DATA_DATE_EPOCH=$(date +%s) \
KO_DOCKER_REPO=ko.local/copy-file-to-pod \
ko build \
--bare \
--platform linux/{{ .Arch }} \
-t v{{ trimprefix .Version "v" }}-{{ .Arch }} \
.
fi'
upx:
- enabled: "{{ not .IsSnapshot }}"
goos:
- linux
compress: "9"
lzma: true
- enabled: "{{ not .IsSnapshot }}"
goos:
- windows
goarch:
- amd64
compress: "9"
lzma: true
archives:
- name_template: '{{ .ProjectName }}_v{{trimprefix .Version "v"}}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
builds:
- mindthegap
- wait-for-file-to-exist
- copy-file-to-pod
kos:
- id: mindthegap
build: mindthegap
labels:
org.opencontainers.image.created: "{{ .CommitDate }}"
org.opencontainers.image.title: mindthegap
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: v{{trimprefix .Version "v"}}
org.opencontainers.image.source: "{{ .GitURL }}"
platforms:
- linux/amd64
- linux/arm64
repository: ghcr.io/mesosphere/mindthegap
bare: true
tags:
- v{{trimprefix .Version "v"}}
- id: wait-for-file-to-exist
build: wait-for-file-to-exist
labels:
org.opencontainers.image.created: "{{ .CommitDate }}"
org.opencontainers.image.title: wait-for-file-to-exist
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: v{{trimprefix .Version "v"}}
org.opencontainers.image.source: "{{ .GitURL }}"
platforms:
- linux/amd64
- linux/arm64
repository: ghcr.io/mesosphere/wait-for-file-to-exist
base_image: cgr.dev/chainguard/busybox
bare: true
tags:
- v{{trimprefix .Version "v"}}
- id: copy-file-to-pod
build: copy-file-to-pod
labels:
org.opencontainers.image.created: "{{ .CommitDate }}"
org.opencontainers.image.title: copy-file-to-pod
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: v{{trimprefix .Version "v"}}
org.opencontainers.image.source: "{{ .GitURL }}"
platforms:
- linux/amd64
- linux/arm64
repository: ghcr.io/mesosphere/copy-file-to-pod
bare: true
tags:
- v{{trimprefix .Version "v"}}
checksum:
name_template: 'checksums.txt'
snapshot:
version_template: "{{ incminor .Tag }}-dev"
report_sizes: true