|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | tag_name: |
7 | | - description: "Tag name for the new release" |
| 7 | + description: "New release tag (e.g., odh-v2.35)" |
8 | 8 | required: true |
| 9 | + type: string |
| 10 | + next_odh_tag: |
| 11 | + description: "Next development tag (e.g., odh-v2.36)" |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + # |
| 15 | + # Note: This workflow assumes the release tag and image tags are in sync. |
| 16 | + # 'tag_name' is used to create the release and as the value to find in files. |
| 17 | + # 'next_odh_tag' provides the new value to set. |
| 18 | + # |
9 | 19 |
|
10 | 20 | permissions: |
11 | 21 | contents: write |
|
80 | 90 | files: bin/* |
81 | 91 | generate_release_notes: true |
82 | 92 | name: ${{ github.event.inputs.tag_name }} |
| 93 | + |
| 94 | + bump-odh-tag: |
| 95 | + name: Bump ODH Tag for Next Release |
| 96 | + runs-on: ubuntu-latest |
| 97 | + needs: changelog |
| 98 | + permissions: |
| 99 | + contents: write |
| 100 | + steps: |
| 101 | + - name: Checkout code |
| 102 | + uses: actions/checkout@v4 |
| 103 | + with: |
| 104 | + ref: ${{ github.ref }} |
| 105 | + |
| 106 | + - name: Update odh-modelmesh-runtime-adapter-push.yaml with next ODH tag |
| 107 | + run: | |
| 108 | + CURRENT_TAG="${{ github.event.inputs.tag_name }}" |
| 109 | + NEXT_TAG="${{ github.event.inputs.next_odh_tag }}" |
| 110 | + |
| 111 | + echo "Updating ODH tag from $CURRENT_TAG to $NEXT_TAG..." |
| 112 | + |
| 113 | + # Using sed to replace the current ODH tag with the next one, |
| 114 | + # anchored to the image name to prevent over-matching. |
| 115 | + sed -i "s|modelmesh-runtime-adapter:${CURRENT_TAG}|modelmesh-runtime-adapter:${NEXT_TAG}|g" .tekton/odh-modelmesh-runtime-adapter-push.yaml |
| 116 | +
|
| 117 | + echo "Update complete." |
| 118 | + |
| 119 | + - name: Commit and Push Changes |
| 120 | + run: | |
| 121 | + git config --global user.email "[email protected]" |
| 122 | + git config --global user.name "GitHub Actions" |
| 123 | + git add .tekton/odh-modelmesh-runtime-adapter-push.yaml |
| 124 | + |
| 125 | + # Check for changes before committing |
| 126 | + if [[ -z "$(git status --porcelain)" ]]; then |
| 127 | + echo "No changes to commit. Exiting." |
| 128 | + else |
| 129 | + git commit -m "chore(konflux): Bump ODH release tag to ${{ github.event.inputs.next_odh_tag }}" |
| 130 | + git push |
| 131 | + fi |
0 commit comments