-
Notifications
You must be signed in to change notification settings - Fork 45
/
.goreleaser.yml
156 lines (141 loc) · 4.31 KB
/
.goreleaser.yml
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
155
156
version: 2
project_name: autotag
env:
- GO111MODULE=on
- CGO_ENABLED=0
- GOPROXY=https://proxy.golang.org
builds:
- binary: autotag
id: macos
main: autotag/main.go
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}}+{{.ShortCommit}}
goos:
- darwin
goarch:
- amd64
- arm64
- binary: autotag
id: linux
main: autotag/main.go
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}}+{{.ShortCommit}}
goos:
- linux
goarch:
- amd64
- arm64
# duplicated builds for amd64 only. Needed by the legacy 'OSX' and 'Linux' binary release formats
- binary: autotag
id: macos-amd64-only
main: autotag/main.go
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}}+{{.ShortCommit}}
goos:
- darwin
goarch:
- amd64
- binary: autotag
id: linux-amd64-only
main: autotag/main.go
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}}+{{.ShortCommit}}
goos:
- linux
goarch:
- amd64
# TODO: verify windows functionality then enable windows release binaries
# - binary: autotag
# id: windows
# main: autotag/main.go
# ldflags:
# - -s -w -X main.version={{.Version}}+{{.ShortCommit}}
# goos:
# - windows
# goarch:
# - amd64
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^readme:"
- "^test:"
- Merge pull request
- Merge branch
# GPG signing
# TODO: consider implementing a "project signing key"
# sign:
# artifacts: checksum
archives:
# Old release format for backwards compatibility with existing scripts: Binary named 'Linux'
- id: old-format-linux
builds: ["linux-amd64-only"]
format: binary
name_template: "Linux"
# Old release format for backwards compatibility with existing scripts: Binary named 'OSX'
- id: old-format-osx
builds: ["macos-amd64-only"]
format: binary
name_template: "OSX"
# New release format, binaries for all platforms in the form: `autotag_linux_amd64`
- id: new-format-binary-only-all-platforms
format: binary
builds: ["linux", "macos"]
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
# archive releases containing: binary, readme, and license. tarballs (macos, linux), zip (windows)
- id: archives
builds: ["linux", "macos"]
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }}'
format_overrides:
- goos: windows
format: zip
dockers:
- dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-amd64" # v1.0.0-amd64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}-amd64" # v1-amd64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-amd64" # v1.0-amd64
- "ghcr.io/autotag-dev/autotag:latest-amd64"
goarch: amd64
- dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-arm64" # v1.0.0-arm64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}-arm64" # v1-arm64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-arm64" # v1.0-arm64
- "ghcr.io/autotag-dev/autotag:latest-arm64"
goarch: arm64
# use `docker_manifests` section to create combined multi-arch image manifests:
docker_manifests:
- name_template: "ghcr.io/autotag-dev/autotag:{{ .Tag }}"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-amd64"
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-arm64"
- name_template: "ghcr.io/autotag-dev/autotag:v{{ .Major }}"
image_templates:
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}-amd64"
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}-arm64"
- name_template: "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-arm64"
- name_template: "ghcr.io/autotag-dev/autotag:latest"
image_templates:
- "ghcr.io/autotag-dev/autotag:latest-amd64"
- "ghcr.io/autotag-dev/autotag:latest-arm64"