@@ -135,9 +135,7 @@ jobs:
135
135
uses : docker/metadata-action@v5
136
136
with :
137
137
images : ghcr.io/${{ github.repository }}/${{ matrix.project }}
138
- tags : |
139
- latest
140
- ${{ github.sha }}
138
+ tags : ${{ github.sha }}
141
139
142
140
- name : Build and push Docker image
143
141
uses : docker/build-push-action@v5
@@ -151,22 +149,56 @@ jobs:
151
149
cache-from : type=gha
152
150
cache-to : type=gha,mode=max
153
151
154
- trigger-helm- release :
152
+ release-charts :
155
153
needs : [identify-changed-projects, build-and-push]
156
154
if : needs.identify-changed-projects.outputs.operator_changed == 'true'
155
+ permissions :
156
+ contents : write
157
157
runs-on : ubuntu-latest
158
158
steps :
159
- - name : Update Helm Chart Values
160
- uses : actions/github-script@v7
159
+ - name : Checkout
160
+ uses : actions/checkout@v4
161
+ with :
162
+ fetch-depth : 0
163
+
164
+ - name : Configure Git
165
+ run : |
166
+ git config user.name "$GITHUB_ACTOR"
167
+ git config user.email "[email protected] "
168
+
169
+ - name : Update Chart Values
170
+ run : |
171
+ # Update the operator image tag in values.yaml
172
+ sed -i "s/tag: .*/tag: ${{ github.sha }}/" k8s/charts/orc/values.yaml
173
+
174
+ # Commit and push changes
175
+ git add k8s/charts/orc/values.yaml
176
+ git commit -m "chore: update operator image tag to ${{ github.sha }}"
177
+ git push
178
+
179
+ - name : Install Helm
180
+ uses : azure/setup-helm@v4
181
+ env :
182
+ GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
183
+
184
+ - name : Add repositories
185
+ run : |
186
+ for dir in $(ls -d k8s/charts/*/); do
187
+ helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
188
+ done
189
+
190
+ - name : Build chart dependencies
191
+ run : |
192
+ for dir in k8s/charts/*/
193
+ do
194
+ (cd ${dir}; helm dependency build)
195
+ done
196
+
197
+ - name : Run chart-releaser
198
+
161
199
with :
162
- github-token : ${{ secrets.GITHUB_TOKEN }}
163
- script : |
164
- await github.rest.actions.createWorkflowDispatch({
165
- owner: context.repo.owner,
166
- repo: context.repo.name,
167
- workflow_id: 'release-charts.yml',
168
- ref: context.ref,
169
- inputs: {
170
- operator_version: '${{ github.sha }}'
171
- }
172
- });
200
+ charts_dir : k8s/charts
201
+ config : ' ./.github/configs/cr.yaml'
202
+ env :
203
+ CR_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
204
+ CR_SKIP_EXISTING : true
0 commit comments