diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-10 12:15:29 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-10 12:31:46 -0700 |
commit | 4822c35cacc513a898e555630b835dc983ad824c (patch) | |
tree | c926f8de3e9afa959c265ff3be9edbf27be17f37 /scripts | |
parent | fd58b21f9af92ebf0bc37cf53eec05feacbe0780 (diff) | |
download | consfigurator-4822c35cacc513a898e555630b835dc983ad824c.tar.gz |
add a script for cutting releases
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/release | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/release b/scripts/release new file mode 100755 index 0000000..e4829f0 --- /dev/null +++ b/scripts/release @@ -0,0 +1,47 @@ +#!/bin/sh + +set -e + +if [ "$#" -ne 1 ]; then + echo >&2 "usage: scripts/release VERSION" + exit 1 +fi + +version=$1 + +if ! (git diff-index --quiet --cached HEAD && \ + git diff-files --quiet && \ + test -z "$(git status --porcelain)" \ + ) >/dev/null 2>&1; then + echo >&2 "must commit first" + exit 1 +fi + +perl -pi -we's/:version ".+"/:version "'$version'"/' consfigurator.asd +perl -pi -we's/^;; Version: .+/;; Version: '$version'/' \ + emacs/consfigurator.el.in +perl -pi -we"s/release = '.+'/release = '$version'/" doc/conf.py + +dist=$(dpkg-parsechangelog -SDistribution) +if [ "$dist" = "UNRELEASED" ]; then + dch -v$version-1 "" +else + dch -v$version-1 New upstream release. +fi +dch -r + +changed_files="consfigurator.asd emacs/consfigurator.el.in doc/conf.py debian/changelog" + +if ! dpkg-parsechangelog | grep -q "New upstream release."; then + echo >&2 'Debian changelog lacks line "New upstream release.""' + git checkout -- $changed_files + exit 1 +fi + +msg="release Consfigurator $version (-1 to Debian experimental)" +git commit -s -m"$msg" -- $changed_files +git tag -s -m"$msg" v$version + +git deborig +# need to pass -d here while we're uploading to experimental +dgit sbuild -d unstable --run-piuparts --run-autopkgtest |