Skip to main content

Config-driven branch and release helpers for Git repositories

Project description

repo-release-tools

repo-release-tools provides a small CLI for branch naming and version bumps in Git repositories. The installed command is rrt.

Install

pip install repo-release-tools

Commands

rrt branch new feat "add parser"
rrt branch rescue fix "recover release work"
rrt bump patch
rrt bump minor --dry-run
rrt bump 1.2.3 --no-changelog

or via uvx:

uvx repo-release-tools branch new feat "add parser"

Configuration

Configure consumer repositories in pyproject.toml:

[tool.rrt]
release_branch = "release/v{version}"
changelog_file = "CHANGELOG.md"
lock_command = ["uv", "lock", "-U"]

[[tool.rrt.version_targets]]
path = "pyproject.toml"
kind = "pep621"

[[tool.rrt.version_targets]]
path = "src/my_package/__init__.py"
pattern = '^(\\s*__version__\\s*=\\s*")([^"]+)(")'

[[tool.rrt.version_targets]]
path = "Cargo.toml"
section = "workspace.package"
field = "version"

Version targets support two modes:

  • kind = "pep621" for [project].version in pyproject.toml
  • a regex target using pattern, or a TOML-style target using section and field

The branch commands are generic. The bump command is config-driven.

pre-commit integration

This repo publishes hooks in .pre-commit-hooks.yaml so other repositories can reuse the naming checks directly.

Example:

repos:
  - repo: https://github.com/Anselmoo/repo-release-tools
    rev: v0.1.0
    hooks:
      - id: rrt-branch-name
      - id: rrt-commit-subject

The hooks enforce:

  • rrt-branch-name: <type>/<kebab-case-description>, plus main, master, develop, and release/v<semver>
  • rrt-commit-subject: Conventional Commits such as feat(cli): add hook checks

GitHub Action

This repo also ships a reusable composite action in action.yml.

Example:

- uses: actions/checkout@v6

- uses: Anselmoo/repo-release-tools@v0.1.0
  with:
    check-branch-name: "true"
    check-commit-subject: "true"

The shared validation logic lives in repo_release_tools.hooks, so the pre-commit hooks and GitHub Action stay in sync.

License

repo-release-tools is released under the MIT License

Built with ❤️ for safe, simple release automation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_release_tools-0.1.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_release_tools-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file repo_release_tools-0.1.0.tar.gz.

File metadata

  • Download URL: repo_release_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for repo_release_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 976e6e51c3fd52a5fbfb2aed94e04cdeec348ae9eeaeb7c005034a5e419bbcd3
MD5 394d8a2ac16677d4f9c203d1c9be3cfe
BLAKE2b-256 5a0fe427ec8996721d4ee9edf2d00cdcd774d0bb312deb8732d51f487484ce1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_release_tools-0.1.0.tar.gz:

Publisher: cicd.yml on Anselmoo/repo-release-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file repo_release_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for repo_release_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e6e245dcb8fec779d2758ac5db805090c0ce4b8e294916025b9c503cdfaacff
MD5 383eae498a641976234c0e8134329a54
BLAKE2b-256 7327a16c82702b37d22ac41bf36ce45ea14a2f38373729463065939818d4f429

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_release_tools-0.1.0-py3-none-any.whl:

Publisher: cicd.yml on Anselmoo/repo-release-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page