From a17d0063a96d5d76c12a677244bd04baeb9b12b4 Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Wed, 14 Jun 2023 13:12:50 +0100 Subject: [PATCH] github: Add common-instancetypes-version annotation during release Signed-off-by: Lee Yarwood --- .github/workflows/release.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4cc4d72e..889a23d4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,9 +12,14 @@ jobs: uses: actions/checkout@v2 - name: Build run: | + export VERSION="${{ github.ref_name }}" for f in $(ls *bundle.yaml); do - cp ${f} ${f/\.yaml/-${{ github.ref_name }}\.yaml} + cp ${f} ${f/\.yaml/-${VERSION}\.yaml} done + + # Install yq and use it to update each resource with an instancetype.kubevirt.io/common-instancetypes-version annotation + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O ./yq && chmod +X ./yq + yq -i '.metadata.annotations.["instancetype.kubevirt.io/common-instancetypes-version"]=env(VERSION)' *bundle-${VERSION}.yaml - name: Release id: release uses: softprops/action-gh-release@v1