Add GitHub-Release-only CD for ci on main - #13
Merged
Conversation
- Add .github/workflows/release.yml: workflow_run on ci completion, gated to successful push runs on main, least-privilege contents:write, per-revision concurrency, checkout of the exact CI head SHA, Python 3.11 build of wheel+sdist, SHA256SUMS generation, and gh release create targeting the checked-out SHA with generated notes. - Skip cleanly when the release already exists; fail closed when the tag exists without a release so tags are never moved or reused. - Document the CD lifecycle in README and CHANGELOG.
- Convert CHANGELOG.md to Keep-a-Changelog format with an empty Unreleased section and a versioned [1.1.0] - 2026-09-02 section. - release.yml: extract exactly the versioned CHANGELOG section and use it as the GitHub Release body via gh release create --notes-file; fail closed before tag/release creation when the section is missing or empty. - ci.yml: add a pull-request-only changelog job that fails unless CHANGELOG.md differs between the PR head and base SHAs. - Add a repository-local pull request template with a required Documentation and changelog section. - Document the policy in AGENTS.md, README.md, and CONTRIBUTING.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds GitHub-Release-only CD to cflan and enforces an explicit changelog for every release and every pull request:
.github/workflows/release.ymltriggers only on a completed, successfulciworkflow run for a push tomain(workflow_run), checks out the exact CI-tested head SHA, builds the wheel and sdist on Python 3.11, generatesSHA256SUMS, and creates a GitHub Release taggedv<version>frompyproject.toml, targeting exactly the checked-out SHA.## [<version>]section ofCHANGELOG.md, extracted at release time and passed togh release create --notes-file. If that version heading or its content is absent, the job fails closed before any tag or release is created.--generate-notesis no longer used.CHANGELOG.mdis converted to a Keep-a-Changelog-style document with an empty## Unreleasedsection and a## [1.1.0] - 2026-09-02section summarizing the already-merged 1.1.0 public-readiness and dry-run/test changes plus this CD change, in reader-ready Added/Changed sections.ci.ymlgains achangelogjob that runs only for pull requests and fails unlessCHANGELOG.mddiffers between the PR head SHA and base SHA, with a remediation message: every PR must add a user-facing Unreleased note, or promote it into a versioned section when increasing the version. All existing CI jobs are unchanged..github/PULL_REQUEST_TEMPLATE.md(based on the organization template, every heading preserved, no HTML comments) adds a required## Documentation and changelogchecklist.AGENTS.md,README.md, andCONTRIBUTING.mddocument the policy: every PR updates the changelog, a release version promotes Unreleased into[<version>], CD publishes only the exact versioned section, and release publication does not prove installation/host/DNS behavior.Safety properties (unchanged or strengthened):
contents: writeonly on release;contents: readon ci; jobifrejects PR and non-mainCI runs; no manual dispatch.release-<sha>) withcancel-in-progress: false.Type of change
Documentation and changelog
## Unreleased— and the already-merged 1.1.0 notes are promoted into## [1.1.0] - 2026-09-02, matching the currentpyproject.tomlversionversioninpyproject.toml, the Unreleased notes are promoted into a## [<version>] - YYYY-MM-DDsection — version is unchanged (1.1.0); the section for it is prepared by this PRValidation
ci(lint/test matrix, package build smoke test, mypy, and the newchangelogenforcement job) is the authoritative validation for this PR; status reported in checks.The
release.ymlworkflow itself cannot execute until merged, becauseworkflow_runtriggers only fire for workflows present on the default branch; its trigger, gating, and notes extraction are therefore validated by review, not by a run. The newchangelogCI job runs on this PR and validates itself against this PR's changelog change.Impact and rollout
Self-contained repository change. After merge, the first successful
cirun onmainwith version1.1.0will attempt to create GitHub Releasev1.1.0whose body is exactly the## [1.1.0] - 2026-09-02changelog section (skipped if the release already exists; fails closed if the tag exists without a release or the section is missing/empty). No PyPI, no deployment, no installed-host changes. Release publication is artifact publication only and does not prove installation, host, or DNS behavior.Safety and secrets
${{ github.token }}and the pre-existing${{ secrets.CODECOV_TOKEN }}workflow expressions appear (Advanced Security secret scanning is not enabled on this repository, so automated scanning was unavailable).This change was produced by an AI agent via the GitHub MCP.