-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.goreleaser.yaml
160 lines (146 loc) · 5.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
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
157
158
159
160
project_name: xk6
version: 2
env:
- IMAGE=grafana/{{.ProjectName}}
before:
hooks:
- go mod tidy
builds:
- id: xk6legacy
binary: xk6
main: ./cmd/xk6
goos: ["linux", "windows", "darwin"]
goarch: ["amd64", "arm64"]
flags: ["-trimpath"]
env: ["CGO_ENABLED=0"]
ldflags:
- "-s -w"
- "-X {{.ModulePath}}/internal/cmd.version={{.Version}}"
- "-X {{.ModulePath}}/internal/cmd.appname={{.Binary}}"
hooks:
post:
- cp "{{ .Path }}" it/xk6
- id: xk6
binary: xk6ea
main: .
goos: ["linux", "windows", "darwin"]
goarch: ["amd64", "arm64"]
flags: ["-trimpath"]
env: ["CGO_ENABLED=0"]
ldflags:
- "-s -w"
- "-X {{.ModulePath}}/internal/cmd.version={{.Version}}"
- "-X {{.ModulePath}}/internal/cmd.appname={{.Binary}}"
hooks:
post:
- cp "{{ .Path }}" it/xk6
- id: fixids
binary: fixids
main: ./internal/fixids
goos: ["linux"]
goarch: ["amd64", "arm64"]
flags: ["-trimpath"]
env: ["CGO_ENABLED=0"]
ldflags: ["-s -w"]
source:
enabled: true
name_template: "{{ .ProjectName }}_{{ .Version }}_source"
archives:
- id: bundle
builds: ["xk6", "xk6legacy"]
formats: ["tar.gz"]
format_overrides:
- goos: windows
formats: ["zip"]
files:
- READMEea.md
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
snapshot:
version_template: "{{ incpatch .Version }}-next+{{.ShortCommit}}{{if .IsGitDirty}}.dirty{{else}}{{end}}"
dockers:
- id: amd64
ids: ["xk6legacy", "fixids"]
dockerfile: Dockerfile.goreleaser
use: buildx
extra_files: ["docker-entrypoint.sh"]
image_templates:
- 'docker.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-amd64'
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}-amd64"
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-amd64"
- "docker.io/{{ .Env.IMAGE }}:latest-amd64"
- 'ghcr.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-amd64'
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}-amd64"
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/{{ .Env.IMAGE }}:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--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.licenses=AGPL-3.0-only"
- id: arm64
ids: ["xk6legacy", "fixids"]
dockerfile: Dockerfile.goreleaser
use: buildx
extra_files: ["docker-entrypoint.sh"]
image_templates:
- 'docker.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-arm64'
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}-arm64"
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-arm64"
- "docker.io/{{ .Env.IMAGE }}:latest-arm64"
- 'ghcr.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-arm64'
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}-arm64"
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-arm64"
- "ghcr.io/{{ .Env.IMAGE }}:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--pull"
- "--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.licenses=AGPL-3.0-only"
docker_manifests:
- id: tag
name_template: 'docker.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}'
image_templates:
- 'docker.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-amd64'
- 'docker.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-arm64'
- id: major
name_template: "docker.io/{{ .Env.IMAGE }}:{{ .Major }}"
image_templates:
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}-amd64"
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}-arm64"
- id: major-minor
name_template: "docker.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}"
image_templates:
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-amd64"
- "docker.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-arm64"
- id: latest
name_template: "docker.io/{{ .Env.IMAGE }}:latest"
image_templates:
- "docker.io/{{ .Env.IMAGE }}:latest-amd64"
- "docker.io/{{ .Env.IMAGE }}:latest-arm64"
- id: tag-ghcr
name_template: 'ghcr.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}'
image_templates:
- 'ghcr.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-amd64'
- 'ghcr.io/{{ .Env.IMAGE }}:{{ replace .Tag "v" "" }}-arm64'
- id: major-ghcr
name_template: "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}"
image_templates:
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}-amd64"
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}-arm64"
- id: major-minor-ghcr
name_template: "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/{{ .Env.IMAGE }}:{{ .Major }}.{{ .Minor }}-arm64"
- id: latest-ghcr
name_template: "ghcr.io/{{ .Env.IMAGE }}:latest"
image_templates:
- "ghcr.io/{{ .Env.IMAGE }}:latest-amd64"
- "ghcr.io/{{ .Env.IMAGE }}:latest-arm64"