-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
156 lines (139 loc) · 5.47 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
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
# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
#
# This is an example-real .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
- go mod tidy
builds:
- targets: [go_first_class]
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
# trims path
- -trimpath
ldflags:
# use commit date instead of current date as main.date
# only needed if you actually use those things in your main package, otherwise can be ignored.
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
nfpms:
- file_name_template: '{{ .ConventionalFileName }}'
homepage: https://goreleaser.com
description: Just another example
maintainer: Carlos Alexandro Becker <carlos@becker.software>
license: MIT
vendor: GoReleaser
bindir: /usr/bin
section: utils
formats: [apk, deb, rpm]
release:
name_template: 'v{{ .Version }}'
footer: |
* * *
<a href="https://goreleser.com"><img src="https://raw.githubusercontent.com/goreleaser/artwork/master/opencollective-header.png" with="100%" alt="GoReleaser logo"></a>
Find example-reals and commented usage of all options in our [website](https://goreleaser.com/intro/).
Want to help? You can [sponsor](https://goreleaser.com/sponsors/),get a [Pro License](https://goreleaser.com/pro) or [contribute](https://goreleaser.com/contributing).
Also, feel free to reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)!
nightly:
publish_release: true
keep_single_release: true
name_template: '{{ incminor .Version }}-nightly'
tag_name: nightly
dockers:
- image_templates:
- 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64'
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.description=Just an example-real"
- "--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"
use: buildx
- image_templates:
- 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64'
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.description=Just an example-real"
- "--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"
use: buildx
# - image_templates:
# - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
# build_flag_templates:
# - "--pull"
# - "--label=org.opencontainers.image.description=Just an example-real"
# - "--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=windows/amd64"
# goos: windows
# dockerfile: windows.dockerfile
docker_manifests:
- name_template: 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}'
image_templates:
- 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64'
- 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64'
# - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
- name_template: '{{ if not .IsNightly }}ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:latest{{ end }}'
image_templates:
- 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64'
- 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64'
# - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
monorepo:
tag_prefix: v # so it always filters out the nightly tag
# signs the checksum file
# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to
# https://goreleaser.com/customization/sign
signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
certificate: '${artifact}.pem'
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: checksum
output: true
# create a source tarball
# https://goreleaser.com/customization/source/
source:
enabled: true
# creates SBOMs of all archives and the source tarball using syft
# https://goreleaser.com/customization/sbom
sboms:
- artifacts: archive
- id: source # Two different sbom configurations need two different IDs
artifacts: source
# signs our docker image
# https://goreleaser.com/customization/docker_sign
docker_signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
artifacts: images
output: true
args:
- 'sign'
- '${artifact}'