1+ name : Update Release Images
2+
3+ on :
4+ release :
5+ types : [published]
6+ workflow_dispatch :
7+ inputs :
8+ tag :
9+ description : ' Tag to update images to (e.g., v0.1.0)'
10+ required : true
11+ type : string
12+
13+ permissions :
14+ contents : write
15+ pull-requests : write
16+
17+ jobs :
18+ update-images :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+ with :
24+ token : ${{ secrets.GITHUB_TOKEN }}
25+ ref : main
26+
27+ - name : Setup Go
28+ uses : actions/setup-go@v5
29+ with :
30+ go-version : ' 1.24.1'
31+
32+ - name : Install yq
33+ uses : mikefarah/yq@v4
34+
35+ - name : Determine version
36+ id : version
37+ run : |
38+ if [[ "${{ github.event_name }}" == "release" ]]; then
39+ TAG="${{ github.event.release.tag_name }}"
40+ else
41+ TAG="${{ inputs.tag }}"
42+ fi
43+ echo "tag=${TAG}" >> $GITHUB_OUTPUT
44+ echo "📦 Updating images to version: ${TAG}"
45+
46+ - name : Update config patches
47+ run : |
48+ TAG="${{ steps.version.outputs.tag }}"
49+
50+ # Update manager deployment patch
51+ cat > config/default/manager_image_patch.yaml << EOF
52+ apiVersion : apps/v1
53+ kind : Deployment
54+ metadata :
55+ name : ome-controller-manager
56+ namespace : ome
57+ spec :
58+ template :
59+ spec :
60+ containers :
61+ - name : manager
62+ image : ghcr.io/moirai-internal/ome-manager:${TAG}
63+ EOF
64+
65+ # Update model agent daemonset patch
66+ cat > config/default/model_agent_image_patch.yaml << EOF
67+ apiVersion : apps/v1
68+ kind : DaemonSet
69+ metadata :
70+ name : ome-model-agent-daemonset
71+ namespace : ome
72+ spec :
73+ template :
74+ spec :
75+ containers :
76+ - name : model-agent
77+ image : ghcr.io/moirai-internal/model-agent:${TAG}
78+ EOF
79+
80+ - name : Update Helm chart values
81+ run : |
82+ TAG="${{ steps.version.outputs.tag }}"
83+
84+ # Update the defaultVersion at the top
85+ yq eval -i '.ome.version = "'${TAG}'"' charts/ome-resources/values.yaml
86+
87+ # Update specific component images
88+ yq eval -i '.ome.multinodeProber.tag = "'${TAG}'"' charts/ome-resources/values.yaml
89+ yq eval -i '.ome.controller.tag = "'${TAG}'"' charts/ome-resources/values.yaml
90+ yq eval -i '.ome.omeAgent.tag = "'${TAG}'"' charts/ome-resources/values.yaml
91+ yq eval -i '.modelAgent.image.tag = "'${TAG}'"' charts/ome-resources/values.yaml
92+
93+ # Update the controller image to use the new namespace format
94+ yq eval -i '.ome.controller.image = "ghcr.io/moirai-internal/ome-manager"' charts/ome-resources/values.yaml
95+
96+ echo "✅ Updated Helm chart values"
97+
98+ - name : Update Chart.yaml versions
99+ run : |
100+ VERSION="${{ steps.version.outputs.tag }}"
101+ VERSION="${VERSION#v}" # Remove 'v' prefix if present
102+
103+ # Update all Chart.yaml files
104+ for chart in charts/*/; do
105+ if [[ -f "${chart}Chart.yaml" ]]; then
106+ yq eval -i ".version = \"${VERSION}\"" "${chart}Chart.yaml"
107+ yq eval -i ".appVersion = \"${VERSION}\"" "${chart}Chart.yaml"
108+ echo "✅ Updated ${chart}Chart.yaml"
109+ fi
110+ done
111+
112+ - name : Validate changes
113+ run : |
114+ echo "📋 Changes made:"
115+ echo ""
116+ echo "Config patches:"
117+ ls -la config/default/*_image_patch.yaml || true
118+ echo ""
119+ echo "Helm values changes:"
120+ git diff charts/ome-resources/values.yaml || true
121+ echo ""
122+ echo "Chart.yaml changes:"
123+ git diff charts/*/Chart.yaml || true
124+
125+ - name : Create Pull Request
126+ uses : peter-evans/create-pull-request@v6
127+ with :
128+ token : ${{ secrets.GITHUB_TOKEN }}
129+ commit-message : |
130+ [Release] Update images to ${{ steps.version.outputs.tag }}
131+
132+ - Update config patches for manager and model-agent
133+ - Update Helm chart default image tags
134+ - Update Chart.yaml versions
135+
136+ Auto-generated by release workflow
137+ branch : update-images-${{ steps.version.outputs.tag }}
138+ delete-branch : true
139+ title : " [Release] Update images to ${{ steps.version.outputs.tag }}"
140+ body : |
141+ ## 🚀 Release Image Update
142+
143+ This PR automatically updates all image references to version `${{ steps.version.outputs.tag }}`.
144+
145+ ### Changes made:
146+ - ✅ Updated config patches for kustomize deployments
147+ - ✅ Updated Helm chart image tags in values.yaml
148+ - ✅ Updated Chart.yaml versions
149+
150+ ### Components updated:
151+ - ome-manager
152+ - model-agent
153+ - multinode-prober
154+ - ome-agent
155+
156+ Please review and merge this PR to ensure `make install` uses the latest release images.
157+
158+ ---
159+ *This PR was automatically generated by the release workflow.*
160+ labels : |
161+ release
162+ automated
163+ assignees : ${{ github.actor }}
0 commit comments