4
4
#
5
5
# This is an example-real .goreleaser.yml file with some sensible defaults.
6
6
# Make sure to check the documentation at https://goreleaser.com
7
+ version : 2
7
8
before :
8
9
hooks :
9
10
- go mod tidy
11
+
10
12
builds :
11
- - targets : [go_first_class]
12
- mod_timestamp : ' {{ .CommitTimestamp }}'
13
- flags :
14
- # trims path
15
- - -trimpath
16
- ldflags :
17
- # use commit date instead of current date as main.date
18
- # only needed if you actually use those things in your main package, otherwise can be ignored.
19
- - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
13
+ - targets : [go_first_class]
14
+ mod_timestamp : " {{ .CommitTimestamp }}"
15
+ flags :
16
+ # trims path
17
+ - -trimpath
18
+ ldflags :
19
+ # use commit date instead of current date as main.date
20
+ # only needed if you actually use those things in your main package, otherwise can be ignored.
21
+ - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
22
+
20
23
checksum :
21
- name_template : ' checksums.txt'
24
+ name_template : " checksums.txt"
25
+
22
26
snapshot :
23
- name_template : " {{ incpatch .Version }}-next"
27
+ version_template : " {{ incpatch .Version }}-next"
28
+
24
29
changelog :
25
30
sort : asc
26
31
filters :
27
32
exclude :
28
- - ' ^docs:'
29
- - ' ^test:'
33
+ - " ^docs:"
34
+ - " ^test:"
30
35
31
36
nfpms :
32
- - file_name_template : ' {{ .ConventionalFileName }}'
33
- homepage : https://goreleaser.com
34
- description : Just another example
35
- maintainer :
Carlos Alexandro Becker <[email protected] >
36
- license : MIT
37
- vendor : GoReleaser
38
- bindir : /usr/bin
39
- section : utils
40
- formats : [apk, deb, rpm]
37
+ - file_name_template : " {{ .ConventionalFileName }}"
38
+ homepage : https://goreleaser.com
39
+ description : Just another example
40
+ maintainer :
Carlos Alexandro Becker <[email protected] >
41
+ license : MIT
42
+ vendor : GoReleaser
43
+ bindir : /usr/bin
44
+ section : utils
45
+ formats : [apk, deb, rpm]
41
46
42
47
release :
43
- name_template : ' v{{ .Version }}'
48
+ name_template : " v{{ .Version }}"
44
49
footer : |
45
50
* * *
46
51
@@ -50,39 +55,37 @@ release:
50
55
Want to help? You can [sponsor](https://goreleaser.com/sponsors/),get a [Pro License](https://goreleaser.com/pro) or [contribute](https://goreleaser.com/contributing).
51
56
Also, feel free to reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)!
52
57
53
-
54
58
nightly :
55
59
publish_release : true
56
60
keep_single_release : true
57
- name_template : ' {{ incminor .Version }}-nightly'
61
+ version_template : " {{ incminor .Version }}-nightly"
58
62
tag_name : nightly
59
63
60
-
61
64
dockers :
62
- - image_templates :
63
- - ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64'
64
- build_flag_templates :
65
- - " --pull"
66
- - " --label=org.opencontainers.image.description=Just an example-real"
67
- - " --label=org.opencontainers.image.created={{.Date}}"
68
- - " --label=org.opencontainers.image.name={{.ProjectName}}"
69
- - " --label=org.opencontainers.image.revision={{.FullCommit}}"
70
- - " --label=org.opencontainers.image.version={{.Version}}"
71
- - " --label=org.opencontainers.image.source={{.GitURL}}"
72
- - " --platform=linux/amd64"
73
- use : buildx
74
- - image_templates :
75
- - ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64'
76
- build_flag_templates :
77
- - " --pull"
78
- - " --label=org.opencontainers.image.description=Just an example-real"
79
- - " --label=org.opencontainers.image.created={{.Date}}"
80
- - " --label=org.opencontainers.image.name={{.ProjectName}}"
81
- - " --label=org.opencontainers.image.revision={{.FullCommit}}"
82
- - " --label=org.opencontainers.image.version={{.Version}}"
83
- - " --label=org.opencontainers.image.source={{.GitURL}}"
84
- - " --platform=linux/arm64"
85
- use : buildx
65
+ - image_templates :
66
+ - " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64"
67
+ build_flag_templates :
68
+ - " --pull"
69
+ - " --label=org.opencontainers.image.description=Just an example-real"
70
+ - " --label=org.opencontainers.image.created={{.Date}}"
71
+ - " --label=org.opencontainers.image.name={{.ProjectName}}"
72
+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
73
+ - " --label=org.opencontainers.image.version={{.Version}}"
74
+ - " --label=org.opencontainers.image.source={{.GitURL}}"
75
+ - " --platform=linux/amd64"
76
+ use : buildx
77
+ - image_templates :
78
+ - " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64"
79
+ build_flag_templates :
80
+ - " --pull"
81
+ - " --label=org.opencontainers.image.description=Just an example-real"
82
+ - " --label=org.opencontainers.image.created={{.Date}}"
83
+ - " --label=org.opencontainers.image.name={{.ProjectName}}"
84
+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
85
+ - " --label=org.opencontainers.image.version={{.Version}}"
86
+ - " --label=org.opencontainers.image.source={{.GitURL}}"
87
+ - " --platform=linux/arm64"
88
+ use : buildx
86
89
# - image_templates:
87
90
# - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
88
91
# build_flag_templates:
@@ -98,36 +101,32 @@ dockers:
98
101
# dockerfile: windows.dockerfile
99
102
100
103
docker_manifests :
101
- - name_template : ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}'
102
- image_templates :
103
- - ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64'
104
- - ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64'
105
- # - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
106
- - name_template : ' {{ if not .IsNightly }}ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:latest{{ end }}'
107
- image_templates :
108
- - ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64'
109
- - ' ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64'
110
- # - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
111
-
112
- monorepo :
113
- tag_prefix : v # so it always filters out the nightly tag
114
-
104
+ - name_template : " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}"
105
+ image_templates :
106
+ - " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64"
107
+ - " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64"
108
+ # - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
109
+ - name_template : " {{ if not .IsNightly }}ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:latest{{ end }}"
110
+ image_templates :
111
+ - " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64"
112
+ - " ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64"
113
+ # - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64'
115
114
116
115
# signs the checksum file
117
116
# 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
118
117
# https://goreleaser.com/customization/sign
119
118
signs :
120
- - cmd : cosign
121
- env :
122
- - COSIGN_EXPERIMENTAL=1
123
- certificate : ' ${artifact}.pem'
124
- args :
125
- - sign-blob
126
- - ' --output-certificate=${certificate}'
127
- - ' --output-signature=${signature}'
128
- - ' ${artifact}'
129
- artifacts : checksum
130
- output : true
119
+ - cmd : cosign
120
+ env :
121
+ - COSIGN_EXPERIMENTAL=1
122
+ certificate : " ${artifact}.pem"
123
+ args :
124
+ - sign-blob
125
+ - " --output-certificate=${certificate}"
126
+ - " --output-signature=${signature}"
127
+ - " ${artifact}"
128
+ artifacts : checksum
129
+ output : true
131
130
132
131
# create a source tarball
133
132
# https://goreleaser.com/customization/source/
@@ -137,20 +136,18 @@ source:
137
136
# creates SBOMs of all archives and the source tarball using syft
138
137
# https://goreleaser.com/customization/sbom
139
138
sboms :
140
- - artifacts : archive
141
- - id : source # Two different sbom configurations need two different IDs
142
- artifacts : source
139
+ - artifacts : archive
140
+ - id : source # Two different sbom configurations need two different IDs
141
+ artifacts : source
143
142
144
143
# signs our docker image
145
144
# https://goreleaser.com/customization/docker_sign
146
145
docker_signs :
147
- - cmd : cosign
148
- env :
149
- - COSIGN_EXPERIMENTAL=1
150
- artifacts : images
151
- output : true
152
- args :
153
- - ' sign'
154
- - ' ${artifact}'
155
-
156
-
146
+ - cmd : cosign
147
+ env :
148
+ - COSIGN_EXPERIMENTAL=1
149
+ artifacts : images
150
+ output : true
151
+ args :
152
+ - " sign"
153
+ - " ${artifact}"
0 commit comments