-
Notifications
You must be signed in to change notification settings - Fork 2
/
.goreleaser.yaml
112 lines (110 loc) · 3.32 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
---
project_name: dsv-github-action
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
before:
hooks:
- go mod download
builds:
- id: dsv-github-action
binary: dsv-github-action
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: replacements
name_template: >-
{{- .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end -}}
- id: binaries
format: binary
checksum:
name_template: checksums.txt
algorithm: sha256
disable: false
snapshot:
name_template: '{{ incpatch .Version }}-next'
changelog:
skip: false
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 }}'
skip_push: false
dockerfile: ./docker/Dockerfile.distroless
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}}
# - --label=org.opencontainers.image.version="{{ .Tag }}"
# local builds
- id: local-docker-images
goos: linux
image_templates:
- '{{ .ProjectName }}:{{ .Tag }}'
- '{{ .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={{.Date}}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.version="{{ .Tag }}"
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'