forked from confluentinc/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
155 lines (150 loc) · 4.37 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
project_name: confluent
dist: dist
before:
hooks:
# TODO: [CLI-92] we delete the semaphore cache during release to workaround an issue with semaphore and goreleaser
- rm -rf $GOPATH/pkg/mod
# NOTE: This will put all builds into the same ./dist folder. There is no way to configure goreleaser output directories per-build, only per-project.
# That means that we should probably not rely on the CI's directory layout for publishing binaries to s3 since cloud and rbac will be intermingled.
builds:
- binary: confluent
id: confluent-alpine-amd64
main: cmd/confluent/main.go
flags:
- -mod=readonly
- -tags=musl
ldflags:
- -s -w -X main.version={{.Env.VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
gcflags:
- all=-trimpath={{.Env.HOME}}/git
asmflags:
- all=-trimpath={{.Env.HOME}}/git
env:
- CGO_ENABLED=1
- CC=x86_64-linux-musl-gcc
- CXX=x86_64-linux-musl-g++
- CGO_LDFLAGS=${CGO_LDFLAGS} -static
goos:
- linux
goarch:
- amd64
- binary: confluent
id: confluent-alpine-arm64
main: cmd/confluent/main.go
flags:
- -mod=readonly
- -tags=musl
ldflags:
- -s -w -X main.version={{.Env.VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
gcflags:
- all=-trimpath={{.Env.HOME}}/git
asmflags:
- all=-trimpath={{.Env.HOME}}/git
env:
- CGO_ENABLED=1
- CC=aarch64-linux-musl-gcc
- CXX=aarch64-linux-musl-g++
- CGO_LDFLAGS=${CGO_LDFLAGS} -static
goos:
- linux
goarch:
- arm64
- binary: confluent
id: confluent-windows-amd64
main: cmd/confluent/main.go
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Env.VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -buildmode=exe
gcflags:
- all=-trimpath={{.Env.HOME}}/git
asmflags:
- all=-trimpath={{.Env.HOME}}/git
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
- CGO_LDFLAGS=${CGO_LDFLAGS} -static
goos:
- windows
goarch:
- amd64
hooks:
pre:
- cmd: az login
- cmd: az keyvault secret download --file CLIEVCodeSigningCertificate2.pfx --name CLIEVCodeSigningCertificate2 --subscription cc-prod --vault-name CLICodeSigningKeyVault --encoding base64
- cmd: xattr -dr com.apple.quarantine ./lib/osslsigncode
post:
- cmd: ./lib/osslsigncode sign -n "Confluent CLI" -i "https://confluent.io" -pkcs12 CLIEVCodeSigningCertificate2.pfx -in {{ .Path }} -out {{ .Path }}
- cmd: rm CLIEVCodeSigningCertificate2.pfx
- binary: confluent
id: signed-amd64
main: cmd/confluent/main.go
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Env.VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
gcflags:
- all=-trimpath={{.Env.HOME}}/git
asmflags:
- all=-trimpath={{.Env.HOME}}/git
goos:
- darwin
goarch:
- amd64
hooks:
post:
- cmd: make download-licenses
- cmd: scripts/gon_filepath_editor.sh {{ .Path }} amd64
- cmd: gon dist/gon_confluent_amd64.hcl
- binary: confluent
id: signed-arm64
main: cmd/confluent/main.go
flags:
- -mod=readonly
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Env.VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
gcflags:
- all=-trimpath={{.Env.HOME}}/git
asmflags:
- all=-trimpath={{.Env.HOME}}/git
goos:
- darwin
goarch:
- arm64
hooks:
post:
- cmd: scripts/gon_filepath_editor.sh {{ .Path }} arm64
- cmd: gon dist/gon_confluent_arm64.hcl
archives:
- id: binary
replacements:
linux: alpine
format: binary
- id: archive
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
replacements:
linux: alpine
format: tar.gz
format_overrides:
- goos: windows
format: zip
wrap_in_directory: "{{ .ProjectName }}"
files:
- LICENSE
- legal/**/*
blobs:
- ids:
- binary
provider: s3
bucket: confluent.cloud
region: us-west-2
folder: "{{.Env.S3FOLDER}}/binaries/{{.Version}}"
- ids:
- archive
provider: s3
bucket: confluent.cloud
region: us-west-2
folder: "{{.Env.S3FOLDER}}/archives/{{.Version}}"