-
Notifications
You must be signed in to change notification settings - Fork 8
/
.goreleaser.yaml
125 lines (121 loc) · 3.9 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
---
version: 2
project_name: dsv-k8s
dist: .artifacts/goreleaser
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
- BUILD_NAME='{{ if index .Env "BUILD_NAME" }}{{ .Env.BUILD_NAME }}{{else}}""{{end}}'
before:
hooks:
- go mod download
builds:
- id: dsv-injector
binary: dsv-injector
main: ./cmd/injector
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w
- -X main.version={{ .Tag }}
- -X main.commit={{ .FullCommit }}
- -X main.date={{ .Now.Format "2006-01-02T15:04:05Z07:00" }} #RFC3339
- -X main.builtBy=goreleaser
- -X main.buildName={{ .Env.BUILD_NAME }}
goos: [linux]
goarch:
- amd64
- id: dsv-syncer
binary: dsv-syncer
main: ./cmd/syncer
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w
- -X main.version={{ .Tag }}
- -X main.commit={{ .FullCommit }}
- -X main.date={{ .Now.Format "2006-01-02T15:04:05Z07:00" }} #RFC3339
- -X main.builtBy=goreleaser
goos: [linux]
goarch:
- amd64
archives:
- id: binaries
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:'
dockers:
- id: docker-publish
goos: linux
# goarch: amd64
# goarm: ''
# goamd64: v2
image_templates:
- '{{ if index .Env "DOCKER_ORG" }}{{ .Env.DOCKER_ORG }}/{{ .ProjectName }}:{{ .Tag }}{{ end }}'
- '{{ if index .Env "DOCKER_ORG" }}{{ .Env.DOCKER_ORG }}/{{ .ProjectName }}:latest{{ end }}'
# tag for quay publishing both with semver and latest tag
- '{{ if index .Env "QUAY_ORG" }}{{ .Env.QUAY_ORG }}/{{ .ProjectName }}:{{ .Tag }}{{ end }}'
- '{{ if index .Env "QUAY_ORG" }}{{ .Env.QUAY_ORG }}/{{ .ProjectName }}:latest{{ end }}'
skip_push: false
dockerfile: ./docker/Dockerfile.distroless
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{ .Now.Format "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}
# - --label=org.opencontainers.image.version="{{ .Tag }}"
# local builds
- id: local-docker-images
goos: linux
image_templates:
- 'dev.local/{{ .ProjectName }}:{{ .Tag }}'
- 'dev.local/{{ .ProjectName }}: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.distroless
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{ .Now.Format "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}
announce:
slack:
enabled: true
# The name of the channel that the user selected as a destination for webhook messages.
channel: '{{ .Env.SLACK_CHANNEL }}'
message_template: ':github: {{ .ProjectName }} {{ .Tag }} is out. {{ .ReleaseURL }}'
# Emoji to use as the icon for this message. Overrides icon_url.
icon_emoji: ':rocket:'
sboms:
- artifacts: binary
documents:
- '${artifact}.spdx.sbom'