Skip to content

Commit 0907471

Browse files
authored
Upgrade goreleaser config to v2 (#58)
1 parent 4ecdffb commit 0907471

2 files changed

Lines changed: 40 additions & 19 deletions

File tree

.goreleaser.yml

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
version: 2
12
before:
23
hooks:
3-
- go mod download
4-
# you may remove this if you don't need go generate
5-
- go generate ./...
4+
- go mod verify
65
project_name: cortextool
76
builds:
87
- id: cortextool-darwin
@@ -11,6 +10,8 @@ builds:
1110
binary: cortextool
1211
env:
1312
- CGO_ENABLED=0
13+
flags:
14+
- -mod=vendor
1415
main: ./cmd/cortextool/main.go
1516
goos:
1617
- darwin
@@ -23,6 +24,8 @@ builds:
2324
binary: cortextool
2425
env:
2526
- CGO_ENABLED=0
27+
flags:
28+
- -mod=vendor
2629
main: ./cmd/cortextool/main.go
2730
goos:
2831
- linux
@@ -34,6 +37,8 @@ builds:
3437
binary: cortextool
3538
env:
3639
- CGO_ENABLED=0
40+
flags:
41+
- -mod=vendor
3742
main: ./cmd/cortextool/main.go
3843
goos:
3944
- windows
@@ -46,6 +51,8 @@ builds:
4651
binary: benchtool
4752
env:
4853
- CGO_ENABLED=0
54+
flags:
55+
- -mod=vendor
4956
main: ./cmd/benchtool/
5057
goos:
5158
- darwin
@@ -58,6 +65,8 @@ builds:
5865
binary: benchtool
5966
env:
6067
- CGO_ENABLED=0
68+
flags:
69+
- -mod=vendor
6170
main: ./cmd/benchtool/
6271
goos:
6372
- linux
@@ -69,39 +78,53 @@ builds:
6978
binary: benchtool
7079
env:
7180
- CGO_ENABLED=0
81+
flags:
82+
- -mod=vendor
7283
main: ./cmd/benchtool/
7384
goos:
7485
- windows
7586
goarch:
7687
- amd64
7788
- 386
7889
archives:
79-
- replacements:
80-
darwin: mac-os
81-
linux: linux
82-
windows: windows
83-
386: i386
84-
amd64: x86_64
90+
- id: cortextool
91+
ids:
92+
- cortextool-darwin
93+
- cortextool-linux
94+
- cortextool-windows
95+
name_template: >-
96+
{{ .Binary }}_{{ .Version }}_{{ if eq .Os "darwin" }}mac-os{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }}
97+
format_overrides:
98+
- goos: windows
99+
formats: [zip]
100+
files:
101+
- none*
102+
formats: [binary]
103+
- id: benchtool
104+
ids:
105+
- benchtool-darwin
106+
- benchtool-linux
107+
- benchtool-windows
108+
name_template: >-
109+
{{ .Binary }}_{{ .Version }}_{{ if eq .Os "darwin" }}mac-os{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }}
85110
format_overrides:
86111
- goos: windows
87-
format: zip
112+
formats: [zip]
88113
files:
89114
- none*
90-
format: binary
115+
formats: [binary]
91116
checksum:
92117
name_template: 'checksums.txt'
93118
snapshot:
94-
name_template: "{{ .Tag }}-next"
119+
version_template: "{{ .Tag }}-next"
95120
changelog:
96121
sort: asc
97122
filters:
98123
exclude:
99124
- '^docs:'
100125
- '^test:'
101126
dockers:
102-
- goos: linux
103-
goarch: amd64
104-
ids:
127+
- ids:
105128
- cortextool-linux
106129
dockerfile: cmd/cortextool/GR.Dockerfile
107130
image_templates:
@@ -114,9 +137,7 @@ dockers:
114137
- "--label=org.opencontainers.image.version={{.Version}}"
115138
- "--label=repository=https://github.com/cortexproject/cortex-tools"
116139
- "--label=homepage=https://cortexmetrics.io"
117-
- goos: linux
118-
goarch: amd64
119-
ids:
140+
- ids:
120141
- benchtool-linux
121142
dockerfile: cmd/benchtool/GR.Dockerfile
122143
image_templates:

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $ git tag -s "${tag}" -m "${tag}"
1111
$ git push origin "${tag}"
1212
```
1313

14-
3. Run `$ goreleaser release --release-notes=changelogs/v0.3.0.md --rm-dist` where the changelog file is the one created as part of step 1.
14+
3. Run `$ goreleaser release --release-notes=changelogs/v0.3.0.md --clean` where the changelog file is the one created as part of step 1.
1515
4. The docker image will be pushed automatically.
1616

1717

0 commit comments

Comments
 (0)