|
18 | 18 | RELEASE_TAG: ${{ github.ref_name }} |
19 | 19 |
|
20 | 20 | jobs: |
21 | | - build-fleet: |
| 21 | + release-fleet: |
22 | 22 | runs-on: runs-on,runner=8cpu-linux-x64,mem=16,run-id=${{ github.run_id }} |
23 | 23 |
|
24 | 24 | env: |
@@ -280,3 +280,66 @@ jobs: |
280 | 280 | run: gh release edit "${RELEASE_TAG}" --draft=false |
281 | 281 | env: |
282 | 282 | 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