Skip to content

Commit d10ba10

Browse files
authored
Add Konflux ODH tag bump automation to our existing release workflow. (#105)
Signed-off-by: Killian Golds <[email protected]>
1 parent 71dad3d commit d10ba10

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed

.github/workflows/create-release-tag.yml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ on:
44
workflow_dispatch:
55
inputs:
66
tag_name:
7-
description: 'Tag name for the new release'
7+
description: 'New release tag (e.g., odh-v2.35)'
88
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+
#
919

1020
permissions:
1121
contents: write
@@ -79,4 +89,42 @@ jobs:
7989
draft: false
8090
files: bin/*
8191
generate_release_notes: true
82-
name: ${{ github.event.inputs.tag_name }}
92+
name: ${{ github.event.inputs.tag_name }}
93+
bump-odh-tag:
94+
name: Bump ODH Tag for Next Release
95+
runs-on: ubuntu-latest
96+
needs: changelog
97+
permissions:
98+
contents: write
99+
steps:
100+
- name: Checkout code
101+
uses: actions/checkout@v4
102+
with:
103+
ref: ${{ github.ref }}
104+
105+
- name: Update odh-modelmesh-push.yaml with next ODH tag
106+
run: |
107+
CURRENT_TAG="${{ github.event.inputs.tag_name }}"
108+
NEXT_TAG="${{ github.event.inputs.next_odh_tag }}"
109+
110+
echo "Updating ODH tag from $CURRENT_TAG to $NEXT_TAG..."
111+
112+
# Using sed to replace the current ODH tag with the next one,
113+
# anchored to the image name to prevent over-matching.
114+
sed -i "s|modelmesh:${CURRENT_TAG}|modelmesh:${NEXT_TAG}|g" .tekton/odh-modelmesh-push.yaml
115+
116+
echo "Update complete."
117+
118+
- name: Commit and Push Changes
119+
run: |
120+
git config --global user.email "[email protected]"
121+
git config --global user.name "GitHub Actions"
122+
git add .tekton/odh-modelmesh-push.yaml
123+
124+
# Check for changes before committing
125+
if [[ -z "$(git status --porcelain)" ]]; then
126+
echo "No changes to commit. Exiting."
127+
else
128+
git commit -m "chore(konflux): Bump ODH release tag to ${{ github.event.inputs.next_odh_tag }}"
129+
git push
130+
fi

0 commit comments

Comments
 (0)