Skip to content

Commit 7e38ea4

Browse files
committed
Dispatch release charts updates
Add the charts bump dispatch job to the v0.12 release workflow. Rename the release job to `release-fleet` to match the main branch.
1 parent cf8f8a6 commit 7e38ea4

1 file changed

Lines changed: 64 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
RELEASE_TAG: ${{ github.ref_name }}
1919

2020
jobs:
21-
build-fleet:
21+
release-fleet:
2222
runs-on: runs-on,runner=8cpu-linux-x64,mem=16,run-id=${{ github.run_id }}
2323

2424
env:
@@ -280,3 +280,66 @@ jobs:
280280
run: gh release edit "${RELEASE_TAG}" --draft=false
281281
env:
282282
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
283+
284+
dispatch-charts-bump:
285+
permissions:
286+
contents: read
287+
id-token: write
288+
runs-on: ubuntu-latest
289+
timeout-minutes: 10
290+
needs: release-fleet
291+
# Skip hotfix releases; they follow a separate process.
292+
if: github.repository == 'rancher/fleet' && !contains(github.ref, '-hotfix-')
293+
steps:
294+
- name: Read App Secrets
295+
uses: rancher-eio/read-vault-secrets@0da85151ad1f19ed7986c41587e45aac1ace74b6 # v3
296+
with:
297+
secrets: |
298+
secret/data/github/repo/${{ github.repository }}/github/workflow-dispatcher/app-credentials appId | APP_ID ;
299+
secret/data/github/repo/${{ github.repository }}/github/workflow-dispatcher/app-credentials privateKey | PRIVATE_KEY
300+
301+
- name: Create App Token
302+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
303+
id: app-token
304+
with:
305+
app-id: ${{ env.APP_ID }}
306+
private-key: ${{ env.PRIVATE_KEY }}
307+
owner: ${{ github.repository_owner }}
308+
repositories: |
309+
charts
310+
fleet-helm-charts
311+
permission-actions: write
312+
313+
- name: Dispatch to rancher/charts
314+
env:
315+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
316+
FLEET_TAG: ${{ github.ref_name }}
317+
run: |
318+
set -euo pipefail
319+
if [[ "$FLEET_TAG" =~ ^v([0-9]+)\.([0-9]+)([.-].*)?$ ]]; then
320+
fleet_minor="${BASH_REMATCH[2]}"
321+
else
322+
echo "Error: unexpected Fleet tag format '${FLEET_TAG}'. Expected tags starting with v<major>.<minor>." >&2
323+
exit 1
324+
fi
325+
if (( fleet_minor < 1 )); then
326+
echo "Error: Fleet tag '${FLEET_TAG}' has minor version ${fleet_minor}; cannot derive a valid rancher/charts target branch." >&2
327+
exit 1
328+
fi
329+
rancher_minor=$((fleet_minor - 1))
330+
target_branch="dev-v2.${rancher_minor}"
331+
echo "Dispatching auto-bump for Fleet ${FLEET_TAG} to rancher/charts branch ${target_branch}"
332+
gh workflow run "Manual Trigger for Auto Bump" \
333+
--repo rancher/charts \
334+
--ref "$target_branch" \
335+
-F chart=fleet \
336+
-F branch="$target_branch" \
337+
-F multi-rc=true
338+
339+
- name: Dispatch to rancher/fleet-helm-charts
340+
env:
341+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
342+
run: |
343+
set -euo pipefail
344+
gh workflow run sync-fleet-releases.yml \
345+
--repo rancher/fleet-helm-charts

0 commit comments

Comments
 (0)