From ba5e5ac9551c807726c727fa97b297db8f5d6211 Mon Sep 17 00:00:00 2001 From: Dusan Nosovic Date: Fri, 1 Mar 2024 12:50:04 +0100 Subject: [PATCH 1/2] added versioning flags --- .goreleaser.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 80af36859d..69f0f853ec 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,12 +17,15 @@ 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 }}' + -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' - id: darwin-arm64 - main: ./main.go - binary: blade - goos: + main: ./main.go + binary: blade + goos: - darwin goarch: - arm64 @@ -30,7 +33,10 @@ 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 }}' + -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' - id: linux-amd64 main: ./main.go @@ -44,7 +50,10 @@ 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 }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' tags: - netgo - osusergo @@ -61,7 +70,10 @@ 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 }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' tags: - netgo - osusergo @@ -109,4 +121,4 @@ docker_manifests: image_templates: - DOCKERHUB_ORGANIZATION/{{ .ProjectName }}:{{ .Version }}-amd64 - DOCKERHUB_ORGANIZATION/{{ .ProjectName }}:{{ .Version }}-arm64 - skip_push: auto + skip_push: auto \ No newline at end of file From d157d1540ef8cfa0f456f18500e848a63e4933ce Mon Sep 17 00:00:00 2001 From: Dusan Nosovic Date: Fri, 1 Mar 2024 13:57:36 +0100 Subject: [PATCH 2/2] comment fix --- .goreleaser.yml | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 69f0f853ec..cfcdcf844a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,15 +17,16 @@ builds: - CC=o64-clang - CXX=o64-clang++ ldflags: - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' + -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 - binary: blade - goos: + main: ./main.go + binary: blade + goos: - darwin goarch: - arm64 @@ -33,10 +34,11 @@ builds: - CC=oa64-clang - CXX=oa64-clang++ ldflags: - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' - -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' + -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 @@ -50,10 +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/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' - -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' - -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' - -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' + -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 @@ -70,10 +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/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' - -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Commit={{ .Commit }}' - -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Branch={{ .Branch }}' - -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime={{ .Date }}' + -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 @@ -121,4 +125,5 @@ docker_manifests: image_templates: - DOCKERHUB_ORGANIZATION/{{ .ProjectName }}:{{ .Version }}-amd64 - DOCKERHUB_ORGANIZATION/{{ .ProjectName }}:{{ .Version }}-arm64 - skip_push: auto \ No newline at end of file + skip_push: auto + \ No newline at end of file