CI: Compress binaries.

This commit is contained in:
Martin Dosch 2023-01-27 09:37:25 +01:00
parent 6d40a6d510
commit 330301bc44
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

View File

@ -34,16 +34,24 @@ format:
compile:
stage: build
only:
- tags
# only:
#- tags
before_script:
- apt-get -qq update && apt-get -qq install -y upx-ucl
script:
- echo "${CI_JOB_ID}" > CI_JOB_ID.txt
- env GOOS=linux GOARCH=amd64 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-amd64/go-sendxmpp
- upx $CI_PROJECT_DIR/linux-amd64/go-sendxmpp
- env GOOS=linux GOARCH=arm64 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm64/go-sendxmpp
- upx $CI_PROJECT_DIR/linux-arm64/go-sendxmpp
- env GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-386/go-sendxmpp
- upx $CI_PROJECT_DIR/linux-386/go-sendxmpp
- env GOOS=linux GOARCH=arm go build -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm/go-sendxmpp
- upx $CI_PROJECT_DIR/linux-arm/go-sendxmpp
- env GOOS=windows GOARCH=386 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/win386/go-sendxmpp.exe
- upx $CI_PROJECT_DIR/win386/go-sendxmpp
- env GOOS=windows GOARCH=amd64 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/win64/go-sendxmpp.exe
- upx $CI_PROJECT_DIR/win64/go-sendxmpp
artifacts:
paths:
- linux-amd64/go-sendxmpp