-
Notifications
You must be signed in to change notification settings - Fork 131
/
.builds-linux.goreleaser.yml
83 lines (79 loc) · 3.2 KB
/
.builds-linux.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
version: 2
env:
# Goreleaser always uses the docker buildx builder with name "default"; see
# https://github.com/goreleaser/goreleaser/pull/3199
# To use a builder other than "default", set this variable.
# Necessary for, e.g., GitHub actions cache integration.
- DOCKER_BUILDX_BUILDER={{ if index .Env "DOCKER_BUILDX_BUILDER" }}{{ .Env.DOCKER_BUILDX_BUILDER }}{{ else }}default{{ end }}
# Setup to enable Docker to use, e.g., the GitHub actions cache; see
# https://docs.docker.com/build/building/cache/backends/
# https://github.com/moby/buildkit#export-cache
- DOCKER_BUILDX_CACHE_FROM={{ if index .Env "DOCKER_BUILDX_CACHE_FROM" }}{{ .Env.DOCKER_BUILDX_CACHE_FROM }}{{ else }}type=registry,ref=docker.io/kubeshop/testkube-cli:latest{{ end }}
- DOCKER_BUILDX_CACHE_TO={{ if index .Env "DOCKER_BUILDX_CACHE_TO" }}{{ .Env.DOCKER_BUILDX_CACHE_TO }}{{ else }}type=inline{{ end }}
before:
hooks:
- go mod tidy
dist: linux
builds:
- main: ./cmd/kubectl-testkube
binary: kubectl-testkube
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- 386
ldflags:
- -s -w -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X main.builtBy=goreleaser
- -X github.com/kubeshop/testkube/pkg/telemetry.TestkubeMeasurementID={{.Env.ANALYTICS_TRACKING_ID}}
- -X github.com/kubeshop/testkube/pkg/telemetry.TestkubeMeasurementSecret={{.Env.ANALYTICS_API_KEY}}
archives:
- format: binary
dockers:
- dockerfile: ./build/kubectl-testkube/Dockerfile
use: buildx
goos: linux
goarch: amd64
image_templates:
- "kubeshop/testkube-cli:{{ .Env.DOCKER_IMAGE_TAG }}-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.created={{ .Date}}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}"
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}"
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}"
- "--build-arg=ALPINE_IMAGE={{ .Env.ALPINE_IMAGE }}"
- "--build-arg=BUSYBOX_IMAGE={{ .Env.BUSYBOX_IMAGE }}"
- dockerfile: ./build/kubectl-testkube/Dockerfile
use: buildx
goos: linux
goarch: arm64
image_templates:
- "kubeshop/testkube-cli:{{ .Env.DOCKER_IMAGE_TAG }}-arm64v8"
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}"
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}"
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}"
- "--build-arg=ALPINE_IMAGE={{ .Env.ALPINE_IMAGE }}"
- "--build-arg=BUSYBOX_IMAGE={{ .Env.BUSYBOX_IMAGE }}"
docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- "--yes"