From 10731da9df051609e3b68687bbe8aa07a88d062d Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Fri, 22 Sep 2023 12:41:07 +0200 Subject: [PATCH] fix: polygon edge version info --- .github/workflows/release.yml | 9 +++++++++ .goreleaser.yml | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6469df577c..cbc17e2a72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,18 +28,24 @@ jobs: run: | TAG=${GITHUB_REF#refs/tags/} echo tag_name=${TAG} >> $GITHUB_OUTPUT + echo release_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $GITHUB_RELEASE_TIME - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Run GoReleaser run: | + echo $(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $RELEASE_TIME docker run \ --rm \ --privileged \ -e CGO_ENABLED=1 \ -e GITHUB_TOKEN \ -e SLACK_WEBHOOK \ + -e GITHUB_REF_NAME=${GITHUB_REF_NAME} \ + -e GITHUB_SHA=${GITHUB_SHA} \ + -e GITHUB_REF=${GITHUB_REF} \ + -e RELEASE_TIME=${RELEASE_TIME} \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/go/src/$(PACKAGE_NAME) \ -w /go/src/$(PACKAGE_NAME) \ @@ -52,3 +58,6 @@ jobs: VERSION: ${{ steps.prepare.outputs.tag_name }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} + GITHUB_REF_NAME: ${{ GITHUB_REF_NAME }} + + diff --git a/.goreleaser.yml b/.goreleaser.yml index 446170d70b..5dfe31ad6c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,7 +16,7 @@ builds: env: - CC=o64-clang - CXX=o64-clang++ - ldflags: -s -w -X 'github.com/topos-protocol/polygon-edge/versioning.Version=v{{ .Version }}' + ldflags: -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Version=${GITHUB_REF_NAME}' - id: darwin-arm64 main: ./main.go @@ -28,7 +28,7 @@ builds: env: - CC=oa64-clang - CXX=oa64-clang++ - ldflags: -s -w -X 'github.com/topos-protocol/polygon-edge/versioning.Version=v{{ .Version }}' + ldflags: -s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' - id: linux-amd64 main: ./main.go @@ -42,7 +42,7 @@ 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/topos-protocol/polygon-edge/versioning.Version=v{{ .Version }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Version=${GITHUB_REF_NAME}' -X 'github.com/0xPolygon/polygon-edge/versioning.Commit=${GITHUB_SHA}' -X 'github.com/0xPolygon/polygon-edge/versioning.Branch=${GITHUB_REF}' -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime=${RELEASE_TIME}' tags: - netgo - osusergo @@ -59,7 +59,7 @@ 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/topos-protocol/polygon-edge/versioning.Version=v{{ .Version }}' + -s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}' tags: - netgo - osusergo