Skip to content

Commit

Permalink
Add release process with changelog support using scriv
Browse files Browse the repository at this point in the history
  • Loading branch information
elikoga committed Oct 29, 2024
1 parent 1e0d7a2 commit 42ae016
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 9 deletions.
Empty file added CHANGES.d/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions CHANGES.d/20241029_095544_elikowa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add release process with changelog support using scriv
1 change: 1 addition & 0 deletions CHANGES.d/20241029_100619_elikowa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fix Component.require_one raising a configuration error with strict=False
2 changes: 2 additions & 0 deletions CHANGES.d/20241029_100632_elikowa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Adds command `./batou secrets decrypttostdout` to decrypt a secrets file to stdout.
- Useful for integration with git diff using textconv, see documentation for installation instructions.
3 changes: 3 additions & 0 deletions CHANGES.d/20241029_100641_elikowa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- The error message shown when a batou deployment fails to start due to another
deployment running at the same time, now correctly informs the user that
another deployment is running instead of showing a traceback. (#446)
11 changes: 2 additions & 9 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
## Changelog


## 2.5.1 (unreleased)
---------------------

- fix Component.require_one raising a configuration error with strict=False
- Adds command `./batou secrets decrypttostdout` to decrypt a secrets file to stdout.
- Useful for integration with git diff using textconv, see documentation for installation instructions.
- The error message shown when a batou deployment fails to start due to another
deployment running at the same time, now correctly informs the user that
another deployment is running instead of showing a traceback. (#446)

- Nothing changed yet.

## 2.5.0 (2024-09-04)
-----------------------
Expand Down Expand Up @@ -87,7 +80,7 @@
## 2.4 (2023-12-06)
----------------------

- Nothing changed yet.
- No changes since 2.4rc2.


## 2.4rc2 (2023-11-29)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ The project is licensed under the 2-clause BSD license.
* Set up GPG for the examples with `export GNUPGHOME=<DIRECTORY OF BATOU HERE>/src/batou/secrets/tests/fixture/gnupg`
* Make sure [age](https://github.com/FiloSottile/age) is installed and in `$PATH` for age encryption support.

## Development and release process

* Changes should be accompanied with a changelog entry. Use `./changelog.sh` to create one.
* Releasing will create a tag and publishes the package to pypi. Use `./release-this.sh` to create a release.

## Changelog

See [CHANGES.md](./CHANGES.md).
11 changes: 11 additions & 0 deletions changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -ex

cd $(dirname $0)
chmod u+w bin/*ctivate* || true
python3 -m venv .
bin/pip install scriv

mkdir -p CHANGES.d
exec bin/scriv create --edit
41 changes: 41 additions & 0 deletions release-this.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
set -euxo pipefail

current_branch=$(git rev-parse --abbrev-ref HEAD)

if [ "$current_branch" != "master" ]; then
set +x
echo
echo
echo "ERROR: can only release from master. We are on $current_branch"
echo
exit 1
fi

changes=$(git status --porcelain)
if [ -n "$changes" ]; then
set +x
echo
echo
echo "ERROR: there are changes."
echo
git status
exit 1
fi

cd $(dirname $0)
chmod u+w bin/*ctivate* || true
python3 -m venv .
bin/pip install zest.releaser scriv
bin/pip install -e .

bin/scriv collect
sed -i .orig '/- Nothing changed yet./ { N; d; } ' CHANGES.md
git add -A .
git status
PAGER= git diff --cached
echo "Press enter to commit, Ctrl-C to abort."
read
git commit -m "Prepare changelog for release"

bin/fullrelease
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ upload-dir = build/doc
[isort]
multi_line_output = 3
include_trailing_comma = true

[tool.scriv]
format = md
fragment_directory = CHANGES.d
output_file = CHANGES.md
version = unreleased
entry_title_template =
new_fragment_template = - New changelog entry.
insert_marker = - Nothing changed yet.
categories =

0 comments on commit 42ae016

Please sign in to comment.