Skip to content

ci: only build release candidates when a release will actually happen - #7

Merged
StoneyJackson merged 1 commit into
mainfrom
ci/skip-release-build-when-no-release
Jul 27, 2026
Merged

ci: only build release candidates when a release will actually happen#7
StoneyJackson merged 1 commit into
mainfrom
ci/skip-release-build-when-no-release

Conversation

@StoneyJackson

Copy link
Copy Markdown
Member

On main the sole purpose of building is to feed a release — PR CI has already verified the code. But build ran unconditionally, so every infra-only merge spent tens of minutes on four legs and pushed candidate images that nothing would ever reference. Two consecutive ci: merges did exactly that today, orphaning 9520c62-* and 3a4af4d-* in GHCR.

Path filtering cannot fix this: a releasing commit type touching only docs would skip the build and leave publish-images with nothing to retag. The release decision, not the diff, is what matters — so a plan job asks semantic-release in dry-run mode first and build is guarded on its answer.

The guard is != 'false' rather than == 'true' deliberately. If the dry run's output is ever empty or unexpected, the build still runs: skipping a build a release needs breaks publishing, while an extra build only costs time.

Also serialises release runs. Two overlapping runs could tag or retag over each other, and a half-finished release is worse than a slow one.

On main the sole purpose of building is to feed a release — PR CI has
already verified the code. But build ran unconditionally, so every
infra-only merge spent tens of minutes on four legs and pushed candidate
images that nothing would ever reference. Two consecutive `ci:` merges
did exactly that today, orphaning 9520c62-* and 3a4af4d-* in GHCR.

Path filtering cannot fix this: a releasing commit type touching only
docs would skip the build and leave publish-images with nothing to
retag. The release decision, not the diff, is what matters — so a `plan`
job asks semantic-release in dry-run mode first and build is guarded on
its answer.

The guard is `!= 'false'` rather than `== 'true'` deliberately. If the
dry run's output is ever empty or unexpected, the build still runs:
skipping a build a release needs breaks publishing, while an extra build
only costs time.

Also serialises release runs. Two overlapping runs could tag or retag
over each other, and a half-finished release is worse than a slow one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 17:59
@StoneyJackson
StoneyJackson merged commit e9c5c26 into main Jul 27, 2026
7 checks passed
@StoneyJackson
StoneyJackson deleted the ci/skip-release-build-when-no-release branch July 27, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Release GitHub Actions workflow to avoid building and pushing candidate devcontainer images on main when semantic-release would not publish a release, reducing unnecessary CI runtime and GHCR churn.

Changes:

  • Added workflow-level concurrency to serialize release runs on main (queue instead of cancel).
  • Introduced a plan job that runs semantic-release in dry-run mode and exports will_release/version outputs.
  • Guarded the build/push steps in the matrix build job based on the plan decision, and wired release to depend on plan.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 56 to 58
build:
needs: plan
strategy:
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