Skip to content

Commit b813c0b

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

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

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

Lines changed: 50 additions & 1 deletion
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
@@ -80,3 +90,42 @@ jobs:
8090
files: bin/*
8191
generate_release_notes: true
8292
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

Comments
 (0)