From 54d0420161688b1923d2c14e35705818ec7d79c5 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 26 Jul 2020 21:21:06 -0400 Subject: [PATCH] tools/release: automate release process #826 --- doc/release-checklist.md | 25 +++++++++++------------ tools/release.sh | 44 +++++++++++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/doc/release-checklist.md b/doc/release-checklist.md index c57a9d1e6..cac0982fa 100644 --- a/doc/release-checklist.md +++ b/doc/release-checklist.md @@ -9,23 +9,22 @@ ## Release -* Run tools/release.sh $OLDVERSION $VERSION +* Run tools/release.sh $OLDVERSION $VERSION "quip" + * Cleans repo with `git clean -f -d -x` * Opens an editor to finalize NEWS.md * Bumps version numbers everywhere they need bumping * Commits changes, tags result with v$VERSION, pushes tag * Downloads new tarball and signs it - * Upload signature to github -* Draft new release at https://github.com/dankamongmen/notcurses/releases - * Title is "v$VERSION—some quip" - * That's an em dash (U+2014, UTF-8 e2 80 94), get it right -* Upload new Rust crate with `cargo publish` -* Upload new Python pip with - * `python3 setup.py sdist` - * `twine upload dist/*` -* Generate and upload new HTML documentation via `make html` - * `scp *.html ../doc/man/index.html qemfd.net:/var/www/notcurses/` -* Generate and upload new Doxygen documentation via `doxygen ../doc/Doxyfile` - * `scp -r html qemfd.net:/var/www/notcurses/` + * Uploads signature to github + * Uploads new Rust crates with `cargo publish` + * Uploads new Python pip with + * `python3 setup.py sdist` + * `twine upload dist/*` + * Generates and uploads new HTML documentation via `make html` + * `scp *.html ../doc/man/index.html qemfd.net:/var/www/notcurses/` + * `scp -r html qemfd.net:/var/www/notcurses/` + * Publishes new release at https://github.com/dankamongmen/notcurses/releases + * Title is "v$VERSION—some quip" ## Packaging diff --git a/tools/release.sh b/tools/release.sh index 33c0b2917..1c5d4a9dc 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -2,32 +2,62 @@ set -e -usage() { echo "usage: `basename $0` oldversion newversion" ; } +usage() { echo "usage: `basename $0` oldversion newversion quip" ; } -[ $# -eq 2 ] || { usage >&2 ; exit 1 ; } +[ $# -eq 3 ] || { usage >&2 ; exit 1 ; } OLDVERSION="$1" VERSION="$2" +QUIP="$3" vi NEWS.md git clean -f -d -x + +# bump version numbers wherever they occur (wherever we enumerate them, anyway) BUMP="CMakeLists.txt doc/Doxyfile doc/man/man*/* doc/man/index.html python/setup.py rust/*/Cargo.toml rust/libnotcurses-sys/build.rs" for i in $BUMP ; do sed -i -e "s/$OLDVERSION/$VERSION/g" $i done -echo "Checking for instances of $OLDVERSION..." -grep -rF "$OLDVERSION" * || true + +# do a build with Doxygen enabled, upload docs, clean it up +mkdir build +cd build +cmake -DUSE_DOXYGEN=on .. +make -j +make test +scp html/* qemfd.net:/var/www/notcurses/html/ +scp *.html ../doc/man/index.html qemfd.net:/var/www/notcurses/ +cd .. +rm -rf build + +# if that all worked, commit, push, and tag git commit -a -m v$VERSION git push git pull git tag -a v$VERSION -m v$VERSION -s git push origin --tags git pull -wget https://github.com/dankamongmen/notcurses/archive/v$VERSION.tar.gz -gpg --sign --armor --detach-sign v$VERSION.tar.gz +TARBALL=v$VERSION.tar.gz +wget https://github.com/dankamongmen/notcurses/archive/$TARBALL +gpg --sign --armor --detach-sign $TARBALL rm v$VERSION.tar.gz -echo "Cut $VERSION, signed to v$VERSION.tar.gz.asc" +echo "Cut $VERSION, signed to $TARBALL.asc" echo "Now upload the sig to https://github.com/dankamongmen/notcurses/releases" echo "The bastards are trying to immanentize the Eschaton" + +# requires token in ~/.netrc +github-release dankamongmen/notcurses create --name "v$VERSION—$QUIP" --publish +github-asset dankamongmen/notcurses upload v$VERSION $TARBALL.asc + +cd ../rust/libnotcurses-sys +cargo clean +cargo publish +cd ../notcurses +cargo clean +cargo publish + +cd ../../python +python3 setup.py sdist +twine upload dist/*