-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRelease
executable file
·31 lines (28 loc) · 1.12 KB
/
Release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
#
# Release script for a generic Python project using pyproject.toml
#
# Run this from the root directory of the project to be released.
# Generally used in conjunction with the instructions in r8format:
# https://github.com/mc68-net/r8format/blob/main/doc/release.md
#
# This is currently a hack that still needs a good bit of manual work
# and checking, but it helps.
#
set -Eeuo pipefail
trap 'echo 1>&2 "INTERNAL ERROR exitcode=$? line=$LINENO"' ERR
die() { local ec=$?; shift; echo 1>&2 "$(basename "$0"):" "$@"; exit $ec; }
[[ -r pyproject.toml ]] || die 1 'pyproject.toml not found'
if grep '^version = ' pyproject.toml | grep -q dev; then
die 1 'pyproject.toml version number includes "dev"'
fi
# XXX test that doc/CHANGELOG.md includes version number above and
# current date
. ./pactivate -q
pip -q install build twine
rm -rf .build/release; mkdir -p .build/release/dist
echo '• pyproject-build (output to .build/release/build.log)'
pyproject-build --outdir .build/release/dist/ >.build/release/build.log
echo '• twine check'
twine check --strict .build/release/dist/*
echo '• OK'