From c85df859043c264d84ea244ddaede986adc44696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Nosovi=C4=87?= <118283942+dusannosovic-ethernal@users.noreply.github.com> Date: Tue, 12 Mar 2024 07:59:44 +0100 Subject: [PATCH] Set versioning build flags in the goreleaser (#131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added versioning flags * comment fix --------- Co-authored-by: Stefan Negovanović --- .goreleaser.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 80af36859d..cfcdcf844a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,7 +17,11 @@ builds: - CC=o64-clang - CXX=o64-clang++ ldflags: - -s -w -X 'github.com/${GITHUB_REPOSITORY}/versioning.Version=v{{ .Version }}' + -s -w + -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' + -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' - id: darwin-arm64 main: ./main.go @@ -30,7 +34,11 @@ builds: - CC=oa64-clang - CXX=oa64-clang++ ldflags: - -s -w -X 'github.com/${GITHUB_REPOSITORY}/versioning.Version=v{{ .Version }}' + -s-w + -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' + -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' - id: linux-amd64 main: ./main.go @@ -44,7 +52,11 @@ builds: - CXX=g++ ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - -s -w -linkmode external -extldflags "-static" -X 'github.com/${GITHUB_REPOSITORY}/versioning.Version=v{{ .Version }}' + -s -w + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' tags: - netgo - osusergo @@ -61,7 +73,11 @@ builds: - CXX=aarch64-linux-gnu-g++ ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - -s -w -linkmode external -extldflags "-static" -X 'github.com/${GITHUB_REPOSITORY}/versioning.Version=v{{ .Version }}' + -s -w + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' tags: - netgo - osusergo @@ -110,3 +126,4 @@ docker_manifests: - DOCKERHUB_ORGANIZATION/{{ .ProjectName }}:{{ .Version }}-amd64 - DOCKERHUB_ORGANIZATION/{{ .ProjectName }}:{{ .Version }}-arm64 skip_push: auto + \ No newline at end of file