Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-0.3] github: Fix bundle version labelling #85

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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