Skip to content

Commit

Permalink
github: Add release update task for SSP operator (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
  • Loading branch information
lyarwood authored Jan 17, 2023
1 parent defc151 commit fabaa36
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,48 @@ jobs:
cp ${f} ${f/\.yaml/-${{ github.ref_name }}\.yaml}
done
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
files: |
*bundle-${{ github.ref_name }}.yaml
LICENSE
- name: Update SSP Operator
run: |
# Define vars
export VERSION="${{ github.ref_name }}"
export RELEASE_FORK_USER=lyarwood
# Set git configs to sign the commit
git config --global user.email "${RELEASE_FORK_USER}@redhat.com"
git config --global user.name "common-instancetypes Release Automation"
# Clone repo and use a token to allow pushing before creating a PR
git clone https://github.com/kubevirt/ssp-operator && cd ssp-operator
git checkout origin/master -b update-common-instancetypes-${VERSION}
# Update the new common-instancetypes file
cp ../common-clusterinstancetypes-bundle.yaml data/common-instancetypes-bundle/
cp ../common-clusterpreferences-bundle.yaml data/common-instancetypes-bundle/
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
git push -f -u release update-common-instancetypes-${VERSION}
# Create a new PR in the operator repo
GH_TOKEN=${{ secrets.RELEASE_FORK_TOKEN }} gh pr create --repo kubevirt/ssp-operator \
--base master \
--head ${RELEASE_FORK_USER}:update-common-instancetypes-${VERSION} \
--title "Update common-instancetypes to ${VERSION}" \
--body "$(cat << EOF
common-instancetypes: Update bundle to ${VERSION}
${{ steps.release.outputs.url }}
**Release note**:
\`\`\`release-note
Update common-instancetypes bundle to ${VERSION}
\`\`\`
EOF
)
"

0 comments on commit fabaa36

Please sign in to comment.