Skip to content

Commit ab94bec

Browse files
committed
Release automation
1 parent 39f3b94 commit ab94bec

5 files changed

Lines changed: 48 additions & 0 deletions

File tree

NEWS.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Incremental 24.11.0 (2025-11-27)
22
================================
33

4+
.. note::
5+
6+
The date above is correct — 25.11.0 was mistakenly released with this version number.
7+
48
Features
59
--------
610

RELEASE.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Releasing Incremental
2+
=====================
3+
4+
To release Incremental, `install just <https://just.systems/>`_ and run `just release`.
5+
6+
This will bump the version,
7+
render `the changelog <./NEWS.rst>`_,
8+
and push the tagged release.
9+
The `release workflow <https://github.com/twisted/incremental/actions/workflows/release.yml>`_
10+
will build and upload the library to PyPI.org.

justfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Update the version, tag a release, and trigger the GHA release workflow
2+
release:
3+
#!/bin/bash
4+
set -exu -o pipefail
5+
# TODO: Replace `tox` with `uv run`
6+
tox -e release --notest
7+
if [[ $(git rev-parse --abbrev-ref HEAD) != trunk ]]
8+
then
9+
echo "ERROR: Must be on trunk branch"
10+
exit 1
11+
fi
12+
if ! git diff --quiet HEAD
13+
then
14+
echo "ERROR: Dirty working copy"
15+
exit 1
16+
fi
17+
# Incremental doesn't do release candidates.
18+
.tox/bin/release/bin/incremental update --rc
19+
.tox/bin/release/bin/incremental update
20+
version=$(.tox/bin/release/bin/hatch version)
21+
tag="incremental-$version"
22+
.tox/bin/release/bin/towncrier build --yes
23+
git add -A NEWS.rst src/incremental/newsfragments src/incremental/_version.py
24+
git commit -am "Release $version"
25+
git tag "$tag"
26+
git push origin "$tag"
27+
git push origin trunk
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add release automation to prevent errors like the mis-numbered 24.11.0 release.

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ commands =
6363
[testenv:build]
6464
# empty environment to build universal wheel once per tox invocation
6565
# https://github.com/ionelmc/tox-wheel#build-configuration
66+
67+
[testenv:release]
68+
description = Release management dependencies
69+
deps =
70+
hatch
71+
towncrier

0 commit comments

Comments
 (0)