-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLI-2823] Add chocolatey to goreleaser config #2365
base: main
Are you sure you want to change the base?
Changes from 3 commits
b8faf55
f1f3959
7f04ea9
e1c3122
a2d1eeb
ede4a2a
a0c9f3f
9be35c3
f98f0c4
dc29d94
f92d854
91ebd77
e365ba3
4bc9aea
d1be0cc
cb3c9e0
6f5ebd2
c872a56
8b640cd
bb3affb
6282f3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
project_name: confluent | ||
|
||
dist: prebuilt | ||
|
||
builds: | ||
- id: confluent-windows-amd64 | ||
binary: confluent | ||
main: cmd/confluent/main.go | ||
ldflags: | ||
- -s -w -X main.version={{.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: | ||
post: | ||
- cmd: ./lib/osslsigncode sign -n "Confluent CLI" -i "https://confluent.io" -pkcs12 CLIEVCodeSigningCertificate2.pfx -in {{ .Path }} -out {{ .Path }} | ||
- id: confluent-windows-amd64-disableupdates | ||
binary: confluent | ||
main: cmd/confluent/main.go | ||
ldflags: | ||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X main.disableUpdates=true -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: | ||
post: | ||
- cmd: ./lib/osslsigncode sign -n "Confluent CLI" -i "https://confluent.io" -pkcs12 CLIEVCodeSigningCertificate2.pfx -in {{ .Path }} -out {{ .Path }} | ||
|
||
release: | ||
disable: true | ||
|
||
archives: | ||
- format: binary |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM --platform=linux/amd64 ubuntu:jammy-20231211.1 | ||
|
||
COPY . /cli/ | ||
|
||
RUN apt update && apt -y install make sudo | ||
|
||
RUN sudo apt -y install git wget build-essential mingw-w64 | ||
|
||
RUN export GO_VERSION=$(cat /cli/.go-version) && \ | ||
wget "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" && \ | ||
sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz" | ||
|
||
ENV PATH=${PATH}:/usr/local/go/bin:/root/go/bin | ||
|
||
RUN cd /cli && make gorelease-windows-amd64 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
function cleanup { | ||
shred --force --remove --zero --iterations=10 CLIEVCodeSigningCertificate2.pfx | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not the end of the world if we don't do this since the CI machines get reset between runs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, but I'm writing this so far on the assumption that we might be releasing before we fully switch to the CI. |
||
rm -rf vendor | ||
} | ||
trap cleanup EXIT | ||
|
||
trap "exit 1" ERR | ||
|
||
az login | ||
az keyvault secret download --file CLIEVCodeSigningCertificate2.pfx --name CLIEVCodeSigningCertificate2 --subscription cc-prod --vault-name CLICodeSigningKeyVault --encoding base64 | ||
xattr -dr com.apple.quarantine ./lib/osslsigncode | ||
|
||
go mod vendor | ||
|
||
# Build windows/amd64 | ||
docker build . --file ./docker/Dockerfile_windows_amd64 --tag cli-windows-amd64-builder-image | ||
docker container create --name cli-windows-amd64-builder cli-windows-amd64-builder-image | ||
docker container cp cli-windows-amd64-builder:/cli/prebuilt/. ./prebuilt/ | ||
docker container rm cli-windows-amd64-builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have other Dockerfiles like this one. Let's make sure they're all using the same ubuntu version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't, unfortunately.
The other Ubuntu image doesn't have a new enough version of
mingw-w64
to be able to cross compile for Windows.This Ubuntu image has
glibc
version 2.35, which is too high for cross compiling Linux arm64 without a breaking change.