Skip to content

ci: trigger release + PyPI publish on tag push#233

Merged
lesnik512 merged 2 commits into
mainfrom
ci/tag-driven-release
Jun 25, 2026
Merged

ci: trigger release + PyPI publish on tag push#233
lesnik512 merged 2 commits into
mainfrom
ci/tag-driven-release

Conversation

@lesnik512

@lesnik512 lesnik512 commented Jun 25, 2026

Copy link
Copy Markdown
Member

What

Makes modern-di's release flow tag-driven. Pushing a semver tag now both publishes to PyPI and creates the matching GitHub Release in one job. Renames publish.ymlrelease.yml to reflect the expanded role.

Before: you manually publish a GitHub Release, which fires publish.ymljust publish.
After: git push origin 2.19.2 → publish to PyPI + create the Release. No manual release-creation step.

Key points

  • Old on: release: published trigger removed. Mandatory, not cosmetic: the workflow now creates a published Release itself, which would re-fire that trigger and double-publish. The tag is the sole entry point.
  • No in-workflow CI gate — by convention a tag is only cut off a green main.
  • PyPI runs first (irreversible). If just publish fails the job stops and no GitHub Release is created advertising a version that never reached PyPI. just publish already derives the version from $GITHUB_REF_NAME, which is the tag under a push: tags event, so it works unchanged.
  • Pre-releases supported via PEP 440 tag form (2.0.0rc1, 2.0.0a5) — flagged as GitHub pre-releases so they aren't marked "Latest". The historical 2.0.0-alpha.5 form is intentionally not matched (not PEP 440; uv version would reject it).
  • Release description comes from planning/releases/<tag>.md when present (verbatim, no auto-changelog appended), else GitHub's generated notes.

Docs

Documents the now-canonical tag-driven process in the CLAUDE.md Workflow section ("Cutting a release (maintainers)"). Kept out of docs/dev/contributing.md since cutting a release is a maintainer-only job, not a contributor step.

Validation

  • YAML parses; job/step structure verified.
  • Tag patterns stable (2.19.2) and pre-release (2.0.0rc1) are disjoint — no double-trigger.
  • Prerelease-flag logic spot-checked: 2.19.2→false; 2.0.0rc1/2.0.0a5/2.0.0b1→true.

🤖 Generated with Claude Code

lesnik512 and others added 2 commits June 25, 2026 10:42
Replace the `on: release: published` trigger with a tag-driven Release
workflow (renamed publish.yml -> release.yml). Pushing a semver tag now
both publishes to PyPI and creates the matching GitHub Release in one
job, collapsing the manual release-creation step into the tag.

- Tag patterns cover stable (2.19.2) and PEP 440 pre-releases (2.0.0rc1);
  the old release-published trigger is removed to avoid a double-publish
  loop, since the workflow now creates a published Release itself.
- PyPI runs first (irreversible); the GitHub Release is created only if
  that step succeeds.
- Release description comes from planning/releases/<tag>.md when present
  (verbatim, no auto-changelog appended), else GitHub's generated notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a "Cutting a release (maintainers)" note to the CLAUDE.md Workflow
section: write planning/releases/<version>.md, push a bare semver tag off
green main, and release.yml publishes to PyPI (version from the tag) + creates
the GitHub Release. Kept out of the contributor-facing docs/dev/contributing.md
since cutting a release is a maintainer-only job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 force-pushed the ci/tag-driven-release branch from d28e219 to d7124c3 Compare June 25, 2026 08:06
@lesnik512 lesnik512 merged commit 45f7eaa into main Jun 25, 2026
7 checks passed
@lesnik512 lesnik512 deleted the ci/tag-driven-release branch June 25, 2026 08:14
lesnik512 added a commit that referenced this pull request Jun 25, 2026
Docs (#231 roadmap, #232 comparison pages) + tag-driven release tooling
(#233). No modern_di/ source change since 2.19.1 — the wheel is functionally
identical; notes say so explicitly.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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