Skip to content

ci: add concurrency guards to the CI, publish, and release workflows - #331

Merged
DemchaAV merged 1 commit into
2.0-devfrom
ci/concurrency-guards
Jul 8, 2026
Merged

ci: add concurrency guards to the CI, publish, and release workflows#331
DemchaAV merged 1 commit into
2.0-devfrom
ci/concurrency-guards

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Why

None of the three tag- or PR-triggered workflows declared a concurrency
block, so two overlapping runs could proceed in parallel. The consequential
case is publish.yml: its deploy is a non-atomic sequence of eight module
uploads
to Maven Central, so two runs racing (e.g. a re-pushed tag, or a tag
push plus a workflow_dispatch re-publish) could interleave uploads.

What changed

  • ci.ymlcancel-in-progress scoped to pull requests only
    (${{ github.event_name == 'pull_request' }}): rapid PR iteration collapses
    to the latest commit's run, while pushes to main / develop / 2.0-dev
    are never cancelled, so every merged commit keeps a complete recorded run.
  • publish.yml — a constant group (publish-maven-central) serializes every
    Central publish through one lane; cancel-in-progress: false so a re-tag or
    dispatch never aborts an upload already in flight — it queues behind it.
  • release.yml — group per tag (release-${{ github.ref }}),
    cancel-in-progress: false: one GitHub Release per tag, never cancelled
    mid-creation; distinct tags still proceed in parallel.

Additive only — 26 lines, no job logic changed.

Verification

All three files parse as valid YAML with the concurrency blocks present
(yaml.safe_load), and GitHub parses the updated ci.yml when it runs this
PR's own CI — a syntax error would surface as a workflow error here.

Note

publish-fonts.yml / publish-emoji.yml also deploy to Central (single
artifact each, so lower race risk). They could take the same guard in a
follow-up if you want full symmetry; left out here to keep this PR to the three
files the audit flagged.

None of the three tag- or PR-triggered workflows declared a concurrency block,
so two overlapping runs could proceed in parallel — most consequentially two
publishes racing on the eight-step, non-atomic Maven Central deploy.

- ci.yml: cancel a superseded run only on pull requests; pushes to the
  integration branches keep every commit's full run.
- publish.yml: funnel all Central publishes through one lane and never cancel an
  upload already in flight.
- release.yml: one GitHub Release per tag, never cancelled mid-creation.
@DemchaAV
DemchaAV merged commit 9bb86e2 into 2.0-dev Jul 8, 2026
12 checks passed
@DemchaAV
DemchaAV deleted the ci/concurrency-guards branch July 8, 2026 10:46
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.

1 participant