-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.goreleaser.yml
142 lines (136 loc) · 4.43 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
---
version: 2
project_name: dsv-k8s-sidecar
dist: .artifacts
env:
- GITHUB_TOKEN=''
- GITLAB_TOKEN=''
- GITEA_TOKEN=''
- LOCAL_DEBUGGING=false # set to make this quick and bypass extra effort builds like archiving zip
- CGO_ENABLED=0
before:
hooks:
- go mod download
builds:
- id: dsv-controller
binary: dsv-controller
main: ./cmd/controller/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w
- -X main.version={{ .Summary }}
- -X main.commit={{ .FullCommit }}
- -X main.date={{ .Timestamp }}
- -X main.builtBy=goreleaser
goos: [linux]
goarch: [amd64]
- id: dsv-k8s-sidecar
binary: dsv-k8s-sidecar
main: ./cmd/client/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w
- -X main.version={{ .Summary }}
- -X main.commit={{ .FullCommit }}
- -X main.date={{ .Timestamp }}
- -X main.builtBy=goreleaser
goos: [linux]
goarch: [amd64]
archives:
- id: binary
format: binary
checksum:
name_template: checksums.txt
algorithm: sha256
disable: false
snapshot:
name_template: '{{ incpatch .Version }}-next'
changelog:
disable: true
sort: asc
use: github
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: 'CI & Chore'
regexp: "^.*(fix|chore|build)[(\\w)]*:+.*$"
order: 2
- title: Others
order: 999
filters:
exclude:
- '^docs:'
- '^test:'
- '^style:'
sboms:
- artifacts: binary
documents:
- '${artifact}.spdx.sbom'
dockers:
- id: docker-publish-controller
ids: [dsv-controller]
goos: linux
image_templates:
- '{{ if index .Env "DOCKER_ORG" }}{{ .Env.DOCKER_ORG }}/dsv-k8s-controller:{{ .Version }}{{ end }}'
- '{{ if index .Env "DOCKER_ORG" }}{{ .Env.DOCKER_ORG }}/dsv-k8s-controller:latest{{ end }}'
- 'dev.local/dsv-k8s-controller:latest'
skip_push: false
dockerfile: ./docker/Dockerfile.controller
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}
- id: docker-publish-client
ids: [dsv-k8s-sidecar]
goos: linux
image_templates:
- '{{ if index .Env "DOCKER_ORG" }}{{ .Env.DOCKER_ORG }}/dsv-k8s-sidecar:{{ .Version }}{{ end }}'
- '{{ if index .Env "DOCKER_ORG" }}{{ .Env.DOCKER_ORG }}/dsv-k8s-sidecar:latest{{ end }}'
skip_push: false
dockerfile: ./docker/Dockerfile.sidecar
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}
# local builds
- id: local-docker-images-controller
ids: [dsv-controller]
goos: linux
image_templates:
- 'dev.local/dsv-k8s-controller:{{ .Version }}'
- 'dev.local/dsv-k8s-controller:latest' # This one is for dev usage so latest version, no tagged semver required in docker compose or local testing
skip_push: true
dockerfile: ./docker/Dockerfile.controller
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}
# local builds
- id: local-docker-images-client
ids: [dsv-k8s-sidecar]
goos: linux
image_templates:
- 'dev.local/dsv-k8s-sidecar:{{ .Version }}'
- 'dev.local/dsv-k8s-sidecar:latest' # This one is for dev usage so latest version, no tagged semver required in docker compose or local testing
skip_push: true
dockerfile: ./docker/Dockerfile.sidecar
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}