Skip to content

✨ Add flopha.toml and flopha release command#30

Open
sjquant wants to merge 2 commits into
mainfrom
claude/flopha-release-command-qwmee7
Open

✨ Add flopha.toml and flopha release command#30
sjquant wants to merge 2 commits into
mainfrom
claude/flopha-release-command-qwmee7

Conversation

@sjquant

@sjquant sjquant commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Why

Every team currently re-derives its own release glue (this repo's release.yml + action/run.sh included): bump a version, edit Cargo.toml/package.json by hand, tag, push, write a changelog, and create a GitHub Release. flopha already has the pieces for each step individually (next-version, changelog); this adds a single orchestrating command driven by a checked-in flopha.toml, so the release contract lives in a config file instead of bash quoting, and manifest sync — the one piece lightweight competitors (svu, git-cliff) skip — is handled natively.

Changes

  • New flopha release command (alias rel) that runs the full pipeline: compute bump → sync manifests → commit → annotated tag → push → changelog → GitHub Release.
  • New flopha.toml schema (src/config.rs) covering [version], [changelog], [release], and repeatable [[manifest]] targets.
  • New src/manifest.rs: syncs the computed version into Cargo.toml / pyproject.toml (via toml_edit, preserving formatting and comments), package.json (via serde_json), or an arbitrary file via a user-supplied regex + replacement.
  • New src/github.rs: creates the GitHub Release by shelling out to gh (same mechanism action/run.sh already uses), resolving the owner/repo slug from the origin remote unless overridden in config.
  • flopha release --dry-run prints the release plan (bump, from/to tag, manifest files that would be touched, changelog preview) without making any changes.
  • Refactored shared logic out of src/service.rs (resolve_increment, next_pre_release_number, build_changelog) so next-version/changelog and the new release pipeline share one implementation instead of duplicating it.
  • Added README.md documentation for the new command and flopha.toml schema.

version.source = "branch" is intentionally unsupported by release — manifest sync, commits, and GitHub Releases all assume tag-based versioning.


Generated by Claude Code

claude added 2 commits July 13, 2026 12:38
One-command, config-driven releases: computes the version bump, syncs it
into manifest files (Cargo.toml, package.json, pyproject.toml, or arbitrary
regex targets), commits, creates an annotated tag, pushes, generates a
changelog, and creates a GitHub Release — all driven by a checked-in
flopha.toml instead of ad-hoc shell orchestration. Supports
`flopha release --dry-run` to print the release plan without side effects.
- flopha release with [changelog] enabled=true always failed: it asked
  for commits up to the not-yet-created tag. Build the changelog against
  HEAD instead, substituting the tag into the title placeholder directly.
- Regex manifest sync now updates every match (not just the first) and
  treats the replacement as a literal string instead of expanding `$1`/
  `$name` capture references.
- Manifest sync now computes every target before writing any of them, so
  a later target failing to parse no longer leaves earlier ones rewritten
  on disk with nothing committed.
- Reject a detached HEAD up front when manifest targets are configured,
  instead of failing obscurely after the commit/tag are already made
  locally with nowhere to push.
- Reuse TagVersionSource::create and service::pre_release_tag instead of
  re-deriving tag creation and pre-release formatting inline.
- Error instead of silently defaulting to 0 when version.pattern doesn't
  capture every version component.
- Clarify the error when GitHub Release creation fails after the tag was
  already pushed.
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