Skip to content

feat: add GitHubProductionRelease workflow for promoting to production#367

Merged
taimos-projen[bot] merged 1 commit into
mainfrom
feat/production-release-workflow
Jun 27, 2026
Merged

feat: add GitHubProductionRelease workflow for promoting to production#367
taimos-projen[bot] merged 1 commit into
mainfrom
feat/production-release-workflow

Conversation

@hoegertn

Copy link
Copy Markdown
Member

Summary

Adds a reusable GitHubProductionRelease component that generates a manual Production Release workflow, modelled on the hand-written production-release.yml used in radball-digital. It is triggered via workflow_dispatch and:

  1. Checks out full history (default GITHUB_TOKEN)
  2. Fast-forward merges the project's default release branch into a selected production branch
  3. Pushes the production branch

This keeps a production promotion a deliberate, auditable action separate from merging to the default branch.

Behaviour

  • Source branch is derived automatically from the project's default release branch — not configurable on the construct. MonorepoProject now exposes a defaultReleaseBranch field so the construct picks it up.
  • Target is selectable. productionBranches (default ['production']) lists the candidate targets. With more than one, the workflow renders a target choice input so the operator picks at dispatch time — e.g. one Amplify app tracking production and another tracking production2.
  • Merge is always --ff-only; the chosen target travels through a TARGET_BRANCH env var (no shell injection from the dispatch input).

Wiring

Opt-in on MonorepoProject via productionRelease: true (+ optional productionReleaseOptions). Existing projects are unchanged until they opt in.

new MonorepoProject({
  defaultReleaseBranch: 'main',
  productionRelease: true,
  productionReleaseOptions: { productionBranches: ['production', 'production2'] },
});

Tests

test/production-release.test.ts — opt-in default-off, default mainproduction, multi-target choice input, default-release-branch-as-source, and the GitHub-required guard. Full projen build (jsii compile + eslint + jest) passes.

Add a reusable GitHubProductionRelease component that generates a manual
"Production Release" workflow. It is triggered via workflow_dispatch and
fast-forward merges the project's default release branch into a selected
production branch, then pushes it. This keeps a production promotion a
deliberate, auditable action separate from merging to the default branch.

When more than one production branch is configured, the workflow exposes a
`target` choice input so the operator picks which branch to promote into at
dispatch time (e.g. one Amplify app tracking `production` and another
`production2`).

Wire it into MonorepoProject as an opt-in `productionRelease` option and
expose the project's `defaultReleaseBranch` so the source branch is derived
automatically.
@taimos-projen taimos-projen Bot enabled auto-merge June 27, 2026 21:06
@taimos-projen taimos-projen Bot added this pull request to the merge queue Jun 27, 2026
Merged via the queue into main with commit 98469b9 Jun 27, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants