From 6cb5e1eb42436cdba8b819d4bd50938369dc1be9 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 13 Dec 2023 01:23:53 +0100 Subject: [PATCH] Fix version generation --- .github/workflows/release.yml | 5 +++-- Dockerfile | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index caef26b..fb6e2b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,8 @@ jobs: SHORT_SHA=$(git rev-parse --short $GITHUB_SHA) VERSION="${BRANCH_NAME}-${SHORT_SHA}" fi - echo "version=$VERSION" >> $GITHUB_ENV + echo "### Version: $VERSION" >> $GITHUB_STEP_SUMMARY + echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -62,4 +63,4 @@ jobs: platforms: linux/amd64,linux/arm64 build-args: | VERSION=${{ steps.version.output.version }} - COMMIT=${{ github.ref }} + COMMIT=${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index 67a85a4..6a74a63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,7 @@ RUN go mod download RUN CGO_ENABLED=0 \ go build \ -trimpath \ - -ldflags "-X github.com/elyby/chrly/version.version=$VERSION -X github.com/elyby/chrly/version.commit=$COMMIT" \ - -ldflags="-w -s" \ + -ldflags "-w -s -X github.com/elyby/chrly/version.version=$VERSION -X github.com/elyby/chrly/version.commit=$COMMIT" \ -o chrly \ main.go