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.0rc3.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.0rc3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: drafteleu-0.5.0rc3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for drafteleu-0.5.0rc3.tar.gz
Algorithm Hash digest
SHA256 8756abcc7c134e1594d918b5741d8d5d47a3cad13991162035352b0c1b2a5baa
MD5 dd63c282a8d233e790d5713f8a4aa42a
BLAKE2b-256 eea7947f99fca7075aa3732603468459dbbdfeb3fec9edc430a5369d0ec56c4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drafteleu-0.5.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 f828cb33181893b48cf78154d6601502db383c38791447f6d01c8198464b8f9b
MD5 436c806d1d54d14d6141ca65b2544987
BLAKE2b-256 7f02f30674be50d5243c47622bb945f542867c77e96aa6ad69aac678b434b03d

See more details on using hashes here.

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