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@v7
        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.6.0rc0.tar.gz (9.1 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.6.0rc0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file drafteleu-0.6.0rc0.tar.gz.

File metadata

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

File hashes

Hashes for drafteleu-0.6.0rc0.tar.gz
Algorithm Hash digest
SHA256 dea6e43cf9a3e234f49eb1feeb511e6d33db99051955aa18a2aa38ba4bff03ad
MD5 14b691f614778ca646b7b4595f97d397
BLAKE2b-256 95c5a9afa0f20e4e4576bcf215b86b93c197202db79ec0213cb82ac19fd04a52

See more details on using hashes here.

Provenance

The following attestation bundles were made for drafteleu-0.6.0rc0.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.6.0rc0-py3-none-any.whl.

File metadata

  • Download URL: drafteleu-0.6.0rc0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 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.6.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f4f96a2e7cb3900649573f0b9090437cc5ab29c2c92cdb71deb0badb4834f2e
MD5 c1b60f7909bb29ab29214932f40a696b
BLAKE2b-256 8a6c1026b5b306818cca94232d18d9eb62b7e56183b7d9ec9d1cf9078f573ae7

See more details on using hashes here.

Provenance

The following attestation bundles were made for drafteleu-0.6.0rc0-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