|
| 1 | +# The OpenJD release train for this repository. The train runs in AWS and holds no GitHub credential: this |
| 2 | +# workflow asks it what to do (start a train for a new upstream release, push a bot/* branch, open its PR, |
| 3 | +# notice a merge, dispatch Release: Bump) and does the GitHub writes with this job's GITHUB_TOKEN. All the logic |
| 4 | +# and its checks live in the reusable workflow; this caller only sets the triggers and forwards the variables |
| 5 | +# and secrets. |
| 6 | +# |
| 7 | +# Inert until an admin sets the variable RELEASE_TRAIN_ENABLED=true (the job is skipped otherwise). |
| 8 | +# RELEASE_TRAIN_MODE names the train's mode, the secret RELEASE_TRAIN_ROLE the AWS role that may invoke the |
| 9 | +# train's gateway. |
| 10 | +# |
| 11 | +# A PR the train opens has its CI held until a maintainer approves the run; review and squash-merge it as |
| 12 | +# usual. The merge (a push to the default branch) runs this workflow, which tells the train. |
| 13 | +# |
| 14 | +# What runs it: a merge pushes, the repository's own "Release: Publish" completing, an upstream repository's |
| 15 | +# run after its release (workflow_dispatch), and a person (workflow_dispatch). A run that started or advanced |
| 16 | +# a train waits for the train's next step. The daily schedule is the backstop for an event that went missing. |
| 17 | +name: Release train |
| 18 | + |
| 19 | +on: |
| 20 | + schedule: |
| 21 | + # Daily backstop, off the hour. |
| 22 | + - cron: "17 6 * * *" |
| 23 | + workflow_dispatch: |
| 24 | + push: |
| 25 | + # The default branch: a merged bot PR is reported right away instead of on the next schedule. |
| 26 | + branches: [mainline] |
| 27 | + # A release: the train sees it without waiting for the schedule. The run is only a signal: it runs this file |
| 28 | + # from the default branch with the default branch's OIDC subject, and the reusable workflow reads nothing of |
| 29 | + # the run that triggered it (no artifact, head ref or event payload). |
| 30 | + workflow_run: # zizmor: ignore[dangerous-triggers] |
| 31 | + workflows: ["Release: Publish"] |
| 32 | + types: [completed] |
| 33 | + |
| 34 | +# One run at a time per repository; a run that finds nothing to do takes a few seconds. |
| 35 | +concurrency: |
| 36 | + group: release-train |
| 37 | + cancel-in-progress: false |
| 38 | + |
| 39 | +permissions: {} |
| 40 | + |
| 41 | +jobs: |
| 42 | + train: |
| 43 | + if: ${{ vars.RELEASE_TRAIN_ENABLED == 'true' }} |
| 44 | + # Our own reusable workflow, referenced by branch like every aws-deadline/.github workflow (the |
| 45 | + # aws-deadline zizmor policy allows that ref pin for aws-deadline/*). |
| 46 | + uses: aws-deadline/.github/.github/workflows/reusable_release_train.yml@mainline |
| 47 | + permissions: |
| 48 | + contents: write # push bot/* branches; create tags and releases (rehearsal only) |
| 49 | + pull-requests: write # open and update the train's PRs and their labels |
| 50 | + actions: write # dispatch this repository's own Release: Bump (live mode) |
| 51 | + id-token: write # OIDC tokens for the AWS role and the gateway |
| 52 | + with: |
| 53 | + mode: ${{ vars.RELEASE_TRAIN_MODE }} |
| 54 | + # The repositories this one may start after a release (also on the train's own allowlist). |
| 55 | + dispatch_repos: "OpenJobDescription/openjd-sessions-for-python OpenJobDescription/openjd-cli aws-deadline/deadline-cloud-worker-agent" |
| 56 | + secrets: |
| 57 | + role_arn: ${{ secrets.RELEASE_TRAIN_ROLE }} |
| 58 | + # The release workflows' token, used only by the dispatch step to run release_train.yml in |
| 59 | + # dispatch_repos. Optional: without it those repositories' daily run picks a release up. |
| 60 | + dispatch_token: ${{ secrets.CI_TOKEN }} |
0 commit comments