forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
210 additions
and
111 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
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.APP_ID }} | ||
private_key: ${{ secrets.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 <QUAY_USERNAME> -p ${{ secrets.QUAY_PASSWORD }} quay.io/opendatahub # Store PODMAN_PASSWORD of opendatahub-io here as a secret. | ||
# skopeo copy docker://quay.io/opendatahub/opendatahub-operator:pr-${{ steps.cpr-dry-run.outputs.pull-request-number }} docker://quay.io/opendatahub/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.APP_ID }} | ||
private_key: ${{ secrets.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: | | ||
NEW_VERSION=${{ env.VERSION }} | ||
CURRENT_VERSION=$(cat Makefile | grep -w "VERSION ?=" | cut -d ' ' -f 3) | ||
sed -i -e "s/^VERSION ?=.*/VERSION ?= $NEW_VERSION/g" Makefile | ||
sed -i -e "s|containerImage.*|containerImage: quay.io/opendatahub/opendatahub-operator:v$NEW_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|createdAt.*|createdAt: \"$(date +"%Y-%-m-%dT00:00:00Z")\"|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|name: opendatahub-operator.v.*|name: opendatahub-operator.v$NEW_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|version: $CURRENT_VERSION.*|version: $NEW_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|olm.skipRange:.*|olm.skipRange: \'>=1.0.0 <$NEW_VERSION\'|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
- 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,AjayJagan,ykaliuta" TODO | ||
- 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 }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: "Release ODH" | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
jobs: | ||
gh-release: | ||
if: github.event.pull_request.merged && startsWith(github.event.pull_request.title, 'ODH Release') && endsWith(github.event.pull_request.title, 'Version Update') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: tibdex/github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
- name: Get release data from pr | ||
run: | | ||
echo ${{ github.event.pull_request.number }} | ||
- name: Get release data from pr | ||
uses: peter-evans/find-comment@v3 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body-includes: "#Release#" | ||
- name: extract data | ||
run: | | ||
echo ${{ steps.fc.outputs.comment-body }} | ||
# - name: Create and push version tags | ||
# run: | | ||
# git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
# git config --global user.name github-actions[bot] | ||
# git checkout odh-${{ env.VERSION }} | ||
# git tag -a -m v${{ env.VERSION }} v${{ env.VERSION }} | ||
# git push origin v${{ env.VERSION }} | ||
# - name: Get component release notes | ||
# id: release-notes | ||
# uses: actions/github-script@v7 | ||
# with: | ||
# script: | | ||
# const script = require('./.github/scripts/get-component-release-notes.js') | ||
# script({github, core}) | ||
# - name: Create GH release | ||
# uses: softprops/action-gh-release@v2 | ||
# with: | ||
# body: ${{ steps.release-notes.outputs.release-notes-body }} | ||
# tag_name: v${{ env.VERSION }} | ||
# generate_release_notes: true | ||
# append_body: true | ||
# make_latest: true | ||
# create-community-operators-pr: | ||
# needs: [gh-release] | ||
# name: Create community operators prod pr # https://github.com/redhat-openshift-ecosystem/community-operators-prod | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: tibdex/github-app-token@v1 | ||
# id: generate-token | ||
# with: | ||
# app_id: ${{ secrets.APP_ID }} | ||
# private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
# - name: Set env variables | ||
# uses: opendatahub-io/opendatahub-operator/.github/actions/set-shared-env@incubation | ||
# with: | ||
# pat-token: ${{ steps.generate-token.outputs.token }} | ||
# - name: Checkout opendatahub-operator | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# path: ./opendatahub-operator | ||
# ref: v${{ env.VERSION }} | ||
# - name: Checkout redhat-openshift-ecosystem/community-operators-prod | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# token: <PAT> # We need a token with repo rights | ||
# repository: redhat-openshift-ecosystem/community-operators-prod # replaced with redhat-openshift-ecosystem/community-operators-prod | ||
# path: ./community-operators-prod | ||
# - name: Copy bundle files and add annotation | ||
# run : | | ||
# ls -la | ||
# # cd community-operators-prod | ||
# # mkdir -p community-operators-prod/operators/opendatahub-operator/${{ env.VERSION }} | ||
# # ls -la | ||
# # cp -a ../opendatahub-operator/bundle/. operators/opendatahub-operator/${{ env.VERSION }}/ | ||
# # echo " | ||
# # # OpenShift specific version | ||
# # com.redhat.openshift.versions: v4.9" >> operators/opendatahub-operator/${{ env.VERSION }}/metadata/annotations.yaml | ||
# # sed -i -e "s|image: REPLACE_IMAGE:latest.*|image: quay.io/opendatahub/opendatahub-operator:v${{ env.VERSION }}|g" operators/opendatahub-operator/${{ env.VERSION }}/manifests/opendatahub-operator.clusterserviceversion.yaml | ||
# # git status | ||
# - name: Create community operators prod pr | ||
# uses: peter-evans/create-pull-request@v6 | ||
# with: | ||
# path: ./community-operators-prod | ||
# token: <PAT> # We need a token with repo rights | ||
# push-to-fork: opendatahub-io/community-operators-prod # Here we can fork community-operators-prod into opendatahub-io and use opendatahub-io/community-operators-prod. eg:https://github.com/maistra/community-operators-prod | ||
# commit-message: ODH Release v${{ env.VERSION }} | ||
# delete-branch: true | ||
# title: operator opendatahub-operator (${{ env.VERSION }}) |