-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
.goreleaser.yml
81 lines (71 loc) · 2.4 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
# Global environment variables for builds.
env:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPROXY=https://proxy.golang.org|direct
- REPO=github.com/operator-framework/operator-sdk
# Hooks to run before any build is run.
before:
hooks:
- go version | grep --quiet "go1\.15\.5" || echo "Go binary version must be 1.15.5"
- go mod download
# Binary builds.
builds:
# operator-sdk build steps
- id: operator-sdk
main: ./cmd/operator-sdk
binary: operator-sdk
mod_timestamp: "{{ .CommitTimestamp }}"
asmflags: &build-asmflags
- all=-trimpath={{ .Env.PWD }}
gcflags: &build-gcflags
- all=-trimpath={{ .Env.PWD }}
ldflags: &build-ldflags
- -X {{ .Env.REPO }}/internal/version.Version={{ .Env.SIMPLE_VERSION }}
- -X {{ .Env.REPO }}/internal/version.GitVersion={{ .Env.GIT_VERSION }}
- -X {{ .Env.REPO }}/internal/version.GitCommit={{ .Env.GIT_COMMIT }}
- -X {{ .Env.REPO }}/internal/version.KubernetesVersion={{ .Env.K8S_VERSION }}
- -X {{ .Env.REPO }}/internal/version.ImageVersion={{ .Env.IMAGE_VERSION }}
targets: &build-targets
- darwin_amd64
- darwin_arm64
- linux_amd64
- linux_arm64
- linux_ppc64le
- linux_s390x
# helm-operator build steps
- id: helm-operator
main: ./cmd/helm-operator
binary: helm-operator
mod_timestamp: "{{ .CommitTimestamp }}"
asmflags: *build-asmflags
gcflags: *build-gcflags
ldflags: *build-ldflags
targets: *build-targets
# Use most recent tag and short commit for snapshot version.
snapshot:
name_template: "{{ .Env.GIT_VERSION }}"
# We don't use archives, so skip creating them.
archives:
- format: binary
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
checksum:
name_template: "checksums.txt"
# Sign the checksum file with the CI GPG key.
signs:
- signature: "${artifact}.asc"
artifacts: checksum
# Use the CI signing subkey A20B5C7E decrypted into .ci/gpg/keyring to sign the release.
args: ["--home", ".ci/gpg/keyring", "-u", "A20B5C7E", "--output", "${signature}", "--detach-sign", "${artifact}"]
# We use a custom changelog generator.
changelog:
# TODO(estroz): configure homebrew publishing
# brews:
# - name: operator-sdk
# ids:
# - operator-sdk
# Uncomment for testing
# release:
# github:
# owner: <your-github-namespace>
# name: operator-sdk