Black has had a lot of work automating its release process. This document sets out to explain what everything does and how to release Black using said automation.
To cut a release, you must be a Black maintainer with GitHub Release creation access. Using this access, the release process is:
CHANGES.md and the docs to version the latest changesUpdate CHANGES.md for XX.X releaseCHANGES.md and copy the raw markdown of the latest changes to use in the description of the GitHub Release.21.6 / 21.5b1If anything fails, please go read the respective action's log output and configuration file to reverse engineer your way to a fix/soluton.
Use the following template for a clean changelog after the release:
## Unreleased
### Highlights
<!-- Include any especially major or disruptive changes here -->
### Style
<!-- Changes that affect Black's stable style -->
### Preview style
<!-- Changes that affect Black's preview style -->
### _Blackd_
<!-- Changes to blackd -->
### Configuration
<!-- Changes to how Black can be configured -->
### Documentation
<!-- Major changes to documentation and policies. Small docs changes
don't need a changelog entry. -->
### Integrations
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
### Output
<!-- Changes to Black's terminal output and error messages -->
### Packaging
<!-- Changes to how Black is packaged, such as dependency requirements -->
### Parser
<!-- Changes to the parser or to version autodetection -->
### Performance
<!-- Changes that improve Black's performance. -->
All Blacks's automation workflows use GitHub Actions. All workflows are therefore configured using .yml files in the .github/workflows directory of the Black repository.
Below are descriptions of our release workflows.
This workflow uses the QEMU powered buildx feature of docker to upload a arm64 and amd64/x86_64 build of the official Black docker image™.
This workflow builds a Python sdist and wheel using the latest setuptools and wheel modules.
It will then use twine to upload both release formats to PyPI for general downloading of the Black Python package. This is where pip looks by default.
This workflow builds self-contained binaries for multiple platforms. This allows people to download the executable for their platform and run Black without a Python Runtime installed.
The created binaries are attached/stored on the associated GitHub Release for download over IPv4 only (GitHub still does not have IPv6 access 😢).
stable tagBlack provides a stable tag for people who want to move along as Black developers deem the newest version reliable. Here the Black developers will move once the release has been problem free for at least ~24 hours from release. Given the large Black userbase we hear about bad bugs quickly. We do strive to continually improve our CI too.
From a rebased main checkout:
git tag -f stable VERSION_TAGgit tag -f stable 21.5b1git push --tags -f