Skip to content

Commit 6cb8a70

Browse files
committed
ci: add the OpenJD release train workflow
The caller of aws-deadline/.github's reusable release-train workflow, inert until the RELEASE_TRAIN_ENABLED variable is true. Dependabot no longer proposes openjd-* updates and the auto-approve job skips them: the release train owns those bumps. Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com>
1 parent 1eaa3c0 commit 6cb8a70

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ updates:
1313
commit-message:
1414
prefix: "chore(deps):"
1515
ignore:
16+
# The OpenJD release train bumps the openjd-* packages itself (release_train.yml), with its tests and
17+
# release notes; a Dependabot PR for them would race it.
18+
- dependency-name: "openjd-*"
1619
# black 26+ drops Python 3.9 compat and produces different formatting
1720
- dependency-name: "black"
1821
update-types: ["version-update:semver-major"]

‎.github/workflows/auto_approve.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
with:
1616
github-token: "${{ secrets.GITHUB_TOKEN }}"
1717
- name: Approve a PR
18+
# Never an openjd-* update: the release train owns those bumps (dependabot.yml ignores them).
19+
if: ${{ !contains(steps.metadata.outputs.dependency-names, 'openjd-') }}
1820
run: gh pr review --approve "$PR_URL"
1921
env:
2022
PR_URL: ${{ github.event.pull_request.html_url }}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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

Comments
 (0)