* contrib/make-release: Update to use maintainer-makefile

This commit is contained in:
Darshit Shah 2021-01-09 10:54:10 +01:00
parent 473eef671b
commit 72ede7a028

View File

@ -1,28 +1,37 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# GNU Wget: Make a new release
#
# This is a helper script to make a new release of GNU Wget
#
# Make sure that
# Author: Darshit Shah <darnir@gnu.org>
set -e
set -o pipefail
set -u
export CFLAGS="-g -O2 -Wall"
export LC_ALL=C
EXTENSIONS="gzip lzip"
ask_continue() {
printf "Continue? [y/N]: "
read inp
read -r inp
[ "$inp" != "y" ] && [ "$inp" != "Y" ] && exit 1
# For some completely weird reason, this set +x is required. Else, the test
# *ALWAYS* fails
set +x
}
REQUIRED_PROGRAMS="ncftpput sponge"
for prog in $REQUIRED_PROGRAMS; do
if ! command -v "$prog" >/dev/null 2>&1; then
2>&1 echo "Required program $prog not found. Please install before proceeding"
exit 1
fi
done
if [ ! -d ".git" ]; then
echo "Please run this script from the root of the git repository"
fi
@ -36,6 +45,7 @@ git clean -dxfq
echo "=> Bootstrap"
./bootstrap > /dev/null 2>&1
autoreconf -ivf
echo "=> Configure"
./configure -q
@ -46,42 +56,33 @@ APP_VER=$(grep "^PACKAGE_VERSION='" configure | cut -d "'" -f2)
echo "Making release for $APP_NAME $APP_VER"
ask_continue
NEWS_VERSION=$(grep -i "Changes in $APP_NAME" NEWS | head -1 | awk '{print $5}')
NEWS_VERSION=$(grep -i "Noteworthy changes in release" NEWS | head -1 | awk '{print $6}')
if [ "$NEWS_VERSION" != "$APP_VER" ]; then
echo "Latest version in NEWS file does not match latest tag"
exit 1
fi
CUR_VER=$(git describe | sed 's/^v//')
PREV_VER=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1) | sed 's/^v//')
LNO_CVER=$(grep -in "Changes in $APP_NAME" NEWS | head -1 | cut -f1 -d:)
PREV_VER=$(cat .prev-version)
LNO_CVER=$(grep -in "Noteworthy changes in release" NEWS | head -1 | cut -f1 -d:)
LNO_PVER=$(grep -in "Changes in $APP_NAME" NEWS | head -2 | tail -1 | cut -f1 -d:)
sed -n "${LNO_CVER},${LNO_PVER}p" NEWS
echo "This is the current contents of your NEWS"
ask_continue
echo "=> Make distcheck"
make -s distcheck > /dev/null 2>&1
for ext in $EXTENSIONS; do
[ "$ext" = 'gz' ] && ext="gzip"
[ "$ext" = 'lz' ] && ext="lzip"
echo "=> Making $APP_NAME-$CUR_VER.tar.$ext"
make -s "dist-$ext" > /dev/null
done
echo ""
REL_TYPE=
REL_LOC=
while [ -z $REL_TYPE ]; do
printf "Enter release type (alpha, beta, stable): "
read x
case $x in
a|A|alpha|Alpha) REL_TYPE=alpha && REL_LOC="alpha.gnu.org";;
b|B|beta|Beta) REL_TYPE=beta && REL_LOC="alpha.gnu.org";;
s|S|stable|Stable) REL_TYPE=stable && REL_LOC="ftp.gnu.org";;
a|A|alpha|Alpha) REL_TYPE=alpha;;
b|B|beta|Beta) REL_TYPE=beta;;
s|S|stable|Stable) REL_TYPE=stable;;
esac
done
echo "=> Make release"
make -s release RELEASE_TYPE=$REL_TYPE
GPG_KEY=
while [ -z $GPG_KEY ]; do
printf "Enter GPG Key ID for Signing: "
@ -94,19 +95,27 @@ done
echo ""
APP_LOWER="$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]')"
./build-aux/gnupload --to "$REL_LOC:$APP_LOWER" --user "$GPG_KEY" --symlink-regex "$APP_LOWER-$CUR_VER".tar.*
upload_command=$(make -s emit_upload_commands RELEASE_TYPE=stable \
| sponge \
| head -n3 \
| tail -1 \
| sed "s/--to/--user $GPG_KEY --symlink-regex --to/g"
)
echo ""
build-aux/announce-gen --release-type "$REL_TYPE" --package-name "$APP_LOWER" --previous-version="$PREV_VER" --current-version "$CUR_VER" --gpg-key-id="$GPG_KEY" --url-directory "https://${REL_LOC}/gnu/${APP_LOWER}" --news=NEWS > "$APP_NAME-$APP_VER.announce"
echo "=> Uploading"
echo "Upload tarballs?"
echo "$upload_command"
ask_continue
$upload_command
echo ""
echo "Remaining Release Checklist:
1. Send a mail to coordinator@translationproject.org with the subject
\"Requesting Translations for $APP_NAME-$APP_VER.POT\"
2. Announce email template placed at $APP_NAME-$APP_VER.announce.
2. Announce email template placed at ~/announce-$APP_NAME-$APP_VER
Send an announce mail to info-gnu@gnu.org
3. Run \`make web-manual\` and \`make web-manual-update\` to update manual online
(Only Stable)
"
echo ""