Skip to content

Commit

Permalink
Merge pull request #85 from kubevirt-bot/cherry-pick-64-to-release-0.3
Browse files Browse the repository at this point in the history
[release-0.3] github: Fix bundle version labelling
  • Loading branch information
kubevirt-bot committed Jul 19, 2023
2 parents 02b1199 + 57ccf3c commit 11f8232
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:
for f in $(ls *bundle.yaml); do
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
for bundle in $(ls *bundle-${VERSION}.yaml); do
yq -i '.metadata.labels.["instancetype.kubevirt.io/common-instancetypes-version"]=env(VERSION)' ${bundle}
done
- name: Release
id: release
uses: softprops/action-gh-release@v1
Expand All @@ -31,7 +33,7 @@ jobs:
run: |
# Define vars
export VERSION="${{ github.ref_name }}"
export RELEASE_FORK_USER=lyarwood
RELEASE_FORK_USER=lyarwood
# Set git configs to sign the commit
git config --global user.email "${RELEASE_FORK_USER}@redhat.com"
Expand All @@ -44,6 +46,13 @@ jobs:
# Update the new common-instancetypes file
cp ../common-clusterinstancetypes-bundle.yaml data/common-instancetypes-bundle/
cp ../common-clusterpreferences-bundle.yaml data/common-instancetypes-bundle/
# 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
for bundle in $(ls data/common-instancetypes-bundle/bundle*.yaml); do
yq -i '.metadata.labels.["instancetype.kubevirt.io/common-instancetypes-version"]=env(VERSION)' ${bundle}
done
git add data && git commit -sm "common-instancetypes: Update bundle to version ${VERSION}"
git remote add release https://${RELEASE_FORK_USER}:${{ secrets.RELEASE_FORK_TOKEN }}@github.com/${RELEASE_FORK_USER}/ssp-operator
Expand Down

0 comments on commit 11f8232

Please sign in to comment.