Skip to content

Disable CGO for building binaries in CI

Jaime Martinez requested to merge 100-disable-cgo into master

The build.yml file was missing the CGO_ENABLED=0 flag to compile the static binary.

Manual QA run in golang:1.16.4

root@b7973bc3ae09:/go/app# file ./bin/binaries/release-cli-linux-amd64 | tr , '\n'
./bin/binaries/release-cli-linux-amd64: ELF 64-bit LSB executable
 x86-64
 version 1 (SYSV)
 statically linked
 Go BuildID=uOzGM6shYA3uz5yvu5W9/lRBatpiCxHdqRxqUQyjO/xdpzLMoOY5zNaVG3_mjN/3cH41iCTFfprqS8Yj6s1
 stripped

root@b7973bc3ae09:/go/app# ./bin/binaries/release-cli-linux-amd64 --server-url "https://gitlab.com" --project-id 18239424 --private-token $TOKEN get --tag-name v1.31.0

INFO[0000] Getting release                               cli=release-cli command=get include-html-description=false project-id=18239424 server-url="https://gitlab.com" tag-name=v1.31.0 version=0.8.0
{"tag_name":"v1.31.0","description":"Created using the release-cli\n\n## Header\n\nSome info","name":"Release v1.31.0","created_at":"2021-05-11T22:25:44.474Z","released_at":"2021-05-11T22:25:44.474Z","author":{"id":4082686,"name":"Jaime Martinez","username":"jaime","state":"active","avatar_url":"https://secure.gravatar.com/avatar/fb41a0e72bf53ee5880daddfdd11dea0?s=80\u0026d=identicon","web_url":"https://gitlab.com/jaime"},"commit":{"id":"c8550886f60d2c970c693604ee93b0002f46c767","short_id":"c8550886","title":"Fail if curl fails","created_at":"2021-05-10T17:12:53+10:00","parent_ids":["950406d2c28a276335e61268aa177e9231654958"],"message":"Fail if curl fails\n","author_name":"Jaime Martinez","author_email":"jmartinez@gitlab.com","authored_date":"2021-05-10T17:12:53+10:00","committer_name":"Jaime Martinez","committer_email":"jmartinez@gitlab.com","committed_date":"2021-05-10T17:12:53+10:00"},"milestones":[{"id":1372491,"iid":3,"project_id":18239424,"title":"m1","description":"m1","state":"active","created_at":"2020-07-19T23:46:11.77Z","updated_at":"2020-07-19T23:46:11.77Z","due_date":"0001-01-01T00:00:00Z","start_date":"0001-01-01T00:00:00Z","web_url":"https://gitlab.com/jaime/hello/-/milestones/3","issue_stats":{"total":0,"closed":0}}],"commit_path":"/jaime/hello/-/commit/c8550886f60d2c970c693604ee93b0002f46c767","tag_path":"/jaime/hello/-/tags/v1.31.0","assets":{"count":7,"sources":[{"format":"zip","url":"https://gitlab.com/jaime/hello/-/archive/v1.31.0/hello-v1.31.0.zip"},{"format":"tar.gz","url":"https://gitlab.com/jaime/hello/-/archive/v1.31.0/hello-v1.31.0.tar.gz"},{"format":"tar.bz2","url":"https://gitlab.com/jaime/hello/-/archive/v1.31.0/hello-v1.31.0.tar.bz2"},{"format":"tar","url":"https://gitlab.com/jaime/hello/-/archive/v1.31.0/hello-v1.31.0.tar"}],"links":[{"id":251583,"name":"asset1","url":"https://example.com/assets/1","external":true,"link_type":"package"},{"id":251582,"name":"asset2","url":"https://example.com/assets/2","external":true,"link_type":"other"},{"id":251581,"name":"hello","url":"https://gitlab.com/api/v4/projects/18239424/packages/generic/hello/v1.31.0/hello","external":true,"link_type":"other"}]},"evidences":[{"sha":"02cb4aef0d01b0bf5791560b130a21cd32c82602f56d","filepath":"https://gitlab.com/jaime/hello/-/releases/v1.31.0/evidences/1029641.json","collected_at":"2021-05-11T22:25:44.578Z"}]}

Closes #100 (closed)

Merge request reports