Push tags and create version update prs #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Pre-Release" | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: The version to update. | |
required: true | |
tracker-url: | |
type: string | |
description: The URL to tracker issue. | |
required: true | |
env: | |
VERSION: ${{ inputs.version }} | |
TRACKER_URL: ${{ inputs.tracker-url }} | |
jobs: | |
dry-run-pr: | |
runs-on: ubuntu-latest | |
name: Create dry-run pr and update tags | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.ODH_RELEASE_APP_ID }} | |
private_key: ${{ secrets.ODH_RELEASE_APP_PRIVATE_KEY }} | |
- name: Validate semver | |
run: ./.github/scripts/validate-semver.sh v${{ env.VERSION }} | |
- uses: ./.github/actions/update-manifest-branches | |
- name: Create dry-run pr | |
uses: peter-evans/create-pull-request@v6 | |
id: cpr-dry-run | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
commit-message: "Test ${{ env.VERSION }} Release" | |
branch: odh-release/e2e-dry-run | |
delete-branch: true | |
title: "[DO NOT MERGE] Test ${{ env.VERSION }} Release" | |
- name: Wait for checks to pass | |
env: | |
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: ./.github/scripts/wait-for-checks.sh ${{ steps.cpr-dry-run.outputs.pull-request-number }} | |
- name: Close PR | |
uses: peter-evans/close-pull@v3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
pull-request-number: ${{ steps.cpr-dry-run.outputs.pull-request-number }} | |
comment: Auto-closing pull request after success checks | |
delete-branch: true | |
- name: Push version tag to quay.io | |
run: | | |
skopeo login -u ${{ secrets.QUAY_ID }} -p ${{ secrets.QUAY_TOKEN }} quay.io/{{ secrets.QUAY_ORG }} | |
skopeo copy docker://quay.io/{{ secrets.QUAY_ORG }}/opendatahub-operator:pr-${{ steps.cpr-dry-run.outputs.pull-request-number }} docker://quay.io/{{ secrets.QUAY_ORG }}/opendatahub-operator:${{ env.VERSION }} | |
echo "Successfully updated tag to quay.io with version: ${{ env.VERSION }}" | |
release-branch-pr: | |
needs: dry-run-pr | |
runs-on: ubuntu-latest | |
name: Create version update pr | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.ODH_RELEASE_APP_ID }} | |
private_key: ${{ secrets.ODH_RELEASE_APP_PRIVATE_KEY }} | |
- name: Create release branch | |
run: | | |
git checkout -b odh-${{ env.VERSION }} | |
git push -f origin odh-${{ env.VERSION }} | |
- uses: ./.github/actions/update-manifest-branches | |
- name: Update versions in relevant files | |
run: ./.github/scripts/update-versions.sh ${{ env.VERSION }} | |
- name: Run make manifests & bundle | |
run: make manifests bundle | |
- name: Clean up | |
run: | | |
sed -i -e "s|image: quay.io/opendatahub/opendatahub-operator:latest.*|image: REPLACE_IMAGE:latest|g" bundle/manifests/opendatahub-operator.clusterserviceversion.yaml | |
rm ./config/manager/kustomization.yaml | |
- name: Create release pr | |
uses: peter-evans/create-pull-request@v6 | |
id: cpr-release-pr | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
commit-message: "ODH Release ${{ env.VERSION }}" | |
branch: odh-release/version-update | |
delete-branch: true | |
title: "ODH Release ${{ env.VERSION }}: Version Update" | |
reviewers: "VaishnaviHire,zdtsw" | |
- name: Wait for checks to pass | |
env: | |
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: ./.github/scripts/wait-for-checks.sh ${{ steps.cpr-release-pr.outputs.pull-request-number }} | |
- name: Comment version and tracker url in the pr | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
#Release# | |
version=${{ env.VERSION }} | |
tracker-url=${{ env.TRACKER_URL }} | |
pr_number: ${{ steps.cpr-release-pr.outputs.pull-request-number }} |