Add your description here
Project description
Drafteleu
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 inowner/repoformat (required). -
--stage
Select which releases to process:pre: Only prereleasesfinal: Only final releasesboth: Both prereleases and final releases (default)
-
--verbosity, -v
Set log verbosity:0: Warnings only1: 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_templateTemplate for the version string. Use this to customize how versions are formatted. Do not include the pre-release suffix here; that is handled byrc_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drafteleu-0.5.0rc5.tar.gz.
File metadata
- Download URL: drafteleu-0.5.0rc5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f25ff9599a1adefbabec04e56ed6d2011790425fd6b43765f0eaa302ea243055
|
|
| MD5 |
f8d0eb7c9a3e22bd5a418cfd49378b49
|
|
| BLAKE2b-256 |
074c590c1c97be9a6e18d98ba4b9434594317789aaf0e503a584ef18aa4afe35
|
Provenance
The following attestation bundles were made for drafteleu-0.5.0rc5.tar.gz:
Publisher:
release.yml on leukeleu/drafteleu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drafteleu-0.5.0rc5.tar.gz -
Subject digest:
f25ff9599a1adefbabec04e56ed6d2011790425fd6b43765f0eaa302ea243055 - Sigstore transparency entry: 658786246
- Sigstore integration time:
-
Permalink:
leukeleu/drafteleu@692df1a9448abea87d916e52799f519bfbb7b614 -
Branch / Tag:
refs/tags/v0.5.0-rc5 - Owner: https://github.com/leukeleu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@692df1a9448abea87d916e52799f519bfbb7b614 -
Trigger Event:
release
-
Statement type:
File details
Details for the file drafteleu-0.5.0rc5-py3-none-any.whl.
File metadata
- Download URL: drafteleu-0.5.0rc5-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f333b871323905187284b47ec4a24432906d75970a705f460656129833a8490c
|
|
| MD5 |
9c9dfc541c01181a9785313176a447fe
|
|
| BLAKE2b-256 |
a1e2942ee4cba56fbb2741d5687c5cbf47b690c8f27da0d1771fb371e054cbc4
|
Provenance
The following attestation bundles were made for drafteleu-0.5.0rc5-py3-none-any.whl:
Publisher:
release.yml on leukeleu/drafteleu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drafteleu-0.5.0rc5-py3-none-any.whl -
Subject digest:
f333b871323905187284b47ec4a24432906d75970a705f460656129833a8490c - Sigstore transparency entry: 658786249
- Sigstore integration time:
-
Permalink:
leukeleu/drafteleu@692df1a9448abea87d916e52799f519bfbb7b614 -
Branch / Tag:
refs/tags/v0.5.0-rc5 - Owner: https://github.com/leukeleu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@692df1a9448abea87d916e52799f519bfbb7b614 -
Trigger Event:
release
-
Statement type: