From 66cdf274caf70b675eb9b22b164d4ec687da98e6 Mon Sep 17 00:00:00 2001 From: Andrei Pavlov Date: Sat, 19 Oct 2024 00:47:04 +0700 Subject: [PATCH] Set version in release wf Signed-off-by: Andrei Pavlov --- .github/workflows/release.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec328e3d3..56b956e78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,10 @@ jobs: with: fetch-depth: 0 + - name: Set version + run: | + TAG=${{ github.ref_name }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Set up Buildx uses: docker/setup-buildx-action@v3 @@ -28,17 +32,17 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - LD_FLAGS=-s -w -X github.com/Mirantis/hmc/internal/build.Version=${{ github.ref_name }} -X github.com/Mirantis/hmc/internal/telemetry.segmentToken=${{ secrets.SEGMENT_TOKEN }} + LD_FLAGS=-s -w -X github.com/Mirantis/hmc/internal/build.Version=${{ env.VERSION }} -X github.com/Mirantis/hmc/internal/telemetry.segmentToken=${{ secrets.SEGMENT_TOKEN }} context: . platforms: linux/amd64,linux/arm64 tags: | - ghcr.io/mirantis/hmc/controller:${{ github.ref_name }} + ghcr.io/mirantis/hmc/controller:${{ env.VERSION }} push: true cache-from: type=gha cache-to: type=gha,mode=max - name: Prepare HMC chart - run: VERSION="${{ github.ref_name }}" make hmc-chart-release + run: VERSION="${{ env.VERSION }}" make hmc-chart-release - name: Push charts to GHCR run: REGISTRY_REPO="oci://ghcr.io/mirantis/hmc/charts" make helm-push @@ -49,7 +53,7 @@ jobs: uses: softprops/action-gh-release@v2 with: generate_release_notes: true - prerelease: ${{ contains(github.ref_name, '-') }} + prerelease: ${{ contains(env.VERSION, '-') }} files: | dist/install.yaml templates/provider/hmc-templates/files/release.yaml