Migrate release automation from scripts/release.py to reflex-release package

Merged
MA
2mo ago
+1311-2915

Type of change

  • Breaking change (the old scripts/release.py is removed and replaced with the reflex-release package)
  • This change requires a documentation update

Summary

This PR completes the migration of the changelog-driven release automation from the monolithic scripts/release.py script to the modular reflex-release package. The old script and its associated shell helper scripts are removed, and the generated CI workflows are now produced by the reflex-release package's templating system.

Key changes:

  1. Removed legacy release infrastructure:

    • scripts/release.py (1329 lines) — the original monolithic release helper
    • scripts/release.py.lock — its dependency lock file
    • tests/units/test_release.py (779 lines) — tests for the old script
    • Shell helper scripts in .github/scripts/dispatch_release/ and .github/scripts/publish/
  2. Migrated to reflex-release package:

    • All release logic now lives in packages/reflex-release/src/reflex_release/
    • Generated workflows are produced by reflex-release sync from [tool.reflex-release] config in pyproject.toml
    • Workflows now include generation headers and drift detection
  3. Enhanced workflow generation:

    • Added uv-version and python-version configuration to pin exact toolchain versions in generated workflows (defaults: uv 0.12.5, Python 3.10)
    • Increased workflow_dispatch package checkbox limit from 9 to 19 (matching GitHub's actual limit)
    • Workflows now include @@UV_SETUP_WITH@@ placeholders for pinned uv setup
    • Added optional .github/scripts/publish/post_build.sh hook for repository-specific artifact checks
  4. Configuration:

    • Added [tool.reflex-release] section to pyproject.toml with package list and workflow configuration
    • Workflows are now generated and checked for drift via reflex-release sync --check
  5. Documentation updates:

    • Updated CONTRIBUTING.md to reference reflex-release create instead of towncrier create
    • Updated packages/reflex-release/README.md with new configuration options
    • Updated AGENTS.md with reflex-release commands

Workflow improvements:

  • publish.yml: Split into five stages (prepare, build, collect, publish, tag-and-release) with clearer separation of concerns
  • dispatch_release.yml: Simplified with generated package checkboxes and improved documentation
  • changelog.yml: Added workflow drift detection and improved guards
  • release_from_changelog.yml: Cleaner structure with generated configuration
  • auto_release_internal.yml: Simplified internal package release automation

All generated workflows include a header indicating they are auto-generated and instructions for regeneration.

Testing

  • Existing unit tests in tests/units/reflex_release/ cover the reflex-release package functionality
  • Added tests for new configuration options (DEFAULT_UV_VERSION, DEFAULT_PYTHON_VERSION)
  • Added tests for workflow template pinning and drift detection
  • CI workflows validate generated workflow consistency via reflex-release sync --check

Migration notes

Repositories using this release automation should:

  1. Run uv run --frozen --package reflex-release reflex-release sync to generate workflows from the new configuration
  2. Optionally add uv-version and python-version to [tool.reflex-release] to pin toolchain versions
  3. Update any custom release scripts to use reflex-release commands instead of scripts/release.py

https://claude.ai/code/session_01KXbekKtPyfbENVnZdTRxKX