Skip to main content

Add your description here

Project description

Drafteleu

drafteleu.png

Drafteleu is a tool designed to maintain and update draft releases on GitHub repositories. It automates the process of keeping draft releases current with the latest changes in the repository, ensuring that they are always ready for publication.

Features

  • Creates or updates draft releases for the next pre-release and the next minor release.
  • Automatically generates release notes based on PR titles.
  • Supports semantic versioning.
  • Supports filtering of PRs by labels and releases by tag prefix.
  • Everything is done via the GitHub API.
  • Multiple releases can be managed in one configuration file.
  • Fast!

Command-Line Interface (CLI)

Drafteleu provides a CLI for managing draft releases.

Prerequisites

The CLI requires the gh (GitHub CLI) tool to be installed and authenticated. You can download it from GitHub CLI.

Basic Usage

uvx drafteleu owner/repo

This command updates or creates draft releases for the specified GitHub repository, using the configuration in drafteleu.yaml.

Options

  • repo_slug
    The GitHub repository in owner/repo format (required).

  • --stage
    Select which releases to process:

    • pre: Only prereleases
    • final: Only final releases
    • both: Both prereleases and final releases (default)
  • --verbosity, -v
    Set log verbosity:

    • 0: Warnings only
    • 1: Info (default)
    • 2: Debug
  • --dry-run
    Run without making changes (for testing).

  • --config
    Path to the configuration file (default: drafteleu.yaml).

Example

uvx drafteleu myorg/myrepo --stage final --verbosity 2 --dry-run --config custom.yaml

This runs Drafteleu for myorg/myrepo, processes only final releases, shows debug output, does not make changes, and uses custom.yaml for configuration.

Github Actions

You can run Drafteleu as part of your CI/CD pipeline using GitHub Actions. Below is an example workflow configuration.

name: Drafteleu
on:
  push:
    branches:
      - main
  release:
    types: [published]

jobs:
  drafteleu:
    name: Drafteleu
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: read
    steps:
      - uses: actions/checkout@v5
        with:
          sparse-checkout: |
            .github/drafteleu.yaml
          sparse-checkout-cone-mode: false

      - uses: astral-sh/setup-uv@v6
        with:
          enable-cache: false
      - name: Run drafteleu
        run: |
          uvx drafteleu --config .github/drafteleu.yaml ${{ github.repository }}
        env:
          GH_TOKEN: ${{ github.token }}

Put your configuration file in .github/drafteleu.yaml and adjust the workflow as needed. Notice that you don't need to check out the whole repository, just the configuration file.

Configuration

Create a drafteleu.yaml file in your project root to configure release generation. Each configuration option is shown below with its default value and an example.

---
title_template: 'Release v{next_version}'         # Default: 'Release {next_version}'
tag_template: 'v{next_version}'                   # Default: 'v{next_version}'
tag_regex: 'v(?P<version>.+)'                     # Default: 'v(?P<version>.+)'
version_template: '{major}.{minor}.{patch}'       # Default: '{major}.{minor}.{patch}'
rc_template: '-{pre_label}{pre_number}'           # Default: '-{pre_label}{pre_number}'
bump_part: 'minor'                                # Default: 'minor'
include_labels: ['feature', 'bugfix']             # Default: [], meaning: all PRs

Options

  • title_template
    Template for the release title. Supports placeholders like {next_version}, {next_tag}, {current_version}, {current_tag}, {current_date}, {stage}.
    Default: Release {next_version}
    Example:

    title_template: 'Release v{next_version} ({stage})'
    
  • tag_template
    Template for the release tag.
    Default: v{next_version}
    Example:

    tag_template: 'release-{next_version}'
    
  • tag_regex
    Regex to match existing release tags and extract the version.
    Default: v(?P<version>.+)
    Example:

    tag_regex: 'release-(?P<version>.+)'
    
  • rc_template
    Template for pre-release (release candidate) suffix.
    Default: -{pre_label}{pre_number}
    Example:

    rc_template: '.rc{pre_number}'
    
  • version_template Template for the version string. Use this to customize how versions are formatted. Do not include the pre-release suffix here; that is handled by rc_template. Default: {major}.{minor}.{patch}' Example:

    version_template: '{major}.{minor}'
    
  • bump_part
    Which part of the version to bump for the next release.
    Default: minor
    Example:

    bump_part: 'patch'
    
  • include_labels
    List of PR labels to include in the changelog.
    Default: [] (all PRs)
    Example:

    include_labels: ['feature', 'bugfix']
    

You can specify multiple configurations in a list for advanced usage. This is useful for monorepos or when you want to manage multiple releases with different settings.

Example:

---
title_template: 'App One v{next_version}'
tag_template: 'app-one/v{next_version}'
tag_regex: 'app-one/v(?P<version>.+)'
include_labels: 
  - app-one
---
title_template: 'App Two v{next_version}'
tag_template: 'app-two/v{next_version}'
tag_regex: 'app-two/v(?P<version>.+)'
include_labels:
  - app-two

See the examples directory for more configuration examples.

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

drafteleu-0.5.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

drafteleu-0.5.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file drafteleu-0.5.0.tar.gz.

File metadata

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

File hashes

Hashes for drafteleu-0.5.0.tar.gz
Algorithm Hash digest
SHA256 147cb438315abf687ed78a2e3573a7ded6c2c1bd1904c0ad970ec745fc9750a7
MD5 9f1d7d6b6fbf8ff11d3453b7a5323e76
BLAKE2b-256 83782464ea63a5871a3f7b0db9ede4b327befd8a07f45d1fd30612224b9cf44c

See more details on using hashes here.

Provenance

The following attestation bundles were made for drafteleu-0.5.0.tar.gz:

Publisher: release.yml on leukeleu/drafteleu

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

File details

Details for the file drafteleu-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: drafteleu-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for drafteleu-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 342afdf06cc081e2caca2993ed0e622d028852388767929d8e3a5f48b9a5d092
MD5 c94e29dae2badc7d1ccf735a3096cc69
BLAKE2b-256 7e55474c02d1d20e1364a3dded4737d0696c370ddc4e8de35838af8b59c2717c

See more details on using hashes here.

Provenance

The following attestation bundles were made for drafteleu-0.5.0-py3-none-any.whl:

Publisher: release.yml on leukeleu/drafteleu

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