Skip to content

Commit

Permalink
Set version in release wf
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Pavlov <[email protected]>
  • Loading branch information
Kshatrix committed Oct 18, 2024
1 parent 575db1e commit 66cdf27
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 66cdf27

Please sign in to comment.