Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/version-update.sh
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
#!/usr/bin/env bash | |||||
# Update the software version number | |||||
usage() { | |||||
echo "Usage: ${0} <version_number>" | |||||
echo | |||||
echo "Version number format should match the following pattern:" | |||||
echo " MAJOR.MINOR.REVISION" | |||||
echo | |||||
echo "Example: ${0} 0.18.7" | |||||
} | |||||
if [ $# -ne 1 ]; then | |||||
usage | |||||
exit 1 | |||||
fi | |||||
# Check the version number is well-formed | |||||
# Format: MAJOR.MINOR.REVISION | |||||
VERSION=`echo "${1}" | grep -E '^(([[:digit:]])+\.){2}[[:digit:]]+$'` | |||||
if [ $? -ne 0 ]; then | |||||
usage | |||||
exit 2 | |||||
fi | |||||
echo "Updating to version ${VERSION}..." | |||||
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} | |||||
IFS='.' read -a VER_ARRAY <<< "${1}" | |||||
MAJOR=${VER_ARRAY[0]} | |||||
MINOR=${VER_ARRAY[1]} | |||||
REVISION=${VER_ARRAY[2]} | |||||
# configure.ac | |||||
echo "Updating ${TOPDIR}/configure.ac" | |||||
sed -ri "s/(define\(_CLIENT_VERSION_MAJOR, )[[:digit:]]+/\1${MAJOR}/g" ${TOPDIR}/configure.ac | |||||
sed -ri "s/(define\(_CLIENT_VERSION_MINOR, )[[:digit:]]+/\1${MINOR}/g" ${TOPDIR}/configure.ac | |||||
sed -ri "s/(define\(_CLIENT_VERSION_REVISION, )[[:digit:]]+/\1${REVISION}/g" ${TOPDIR}/configure.ac | |||||
# Doxyfile | |||||
echo "Updating ${TOPDIR}/doc/Doxyfile" | |||||
sed -ri "s/^(PROJECT_NUMBER\s+= )[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/\1${VERSION}/g" ${TOPDIR}/doc/Doxyfile | |||||
# release-notes.md | |||||
CURRENT_VERSION=`head -n1 ${TOPDIR}/doc/release-notes.md | grep -Eo '([[:digit:]]+\.){2}[[:digit:]]'` | |||||
echo "Copying current release notes to ${TOPDIR}/doc/release-notes/release-notes-${CURRENT_VERSION}.md" | |||||
cp ${TOPDIR}/doc/release-notes.md ${TOPDIR}/doc/release-notes/release-notes-${CURRENT_VERSION}.md | |||||
echo "Creating new empty ${TOPDIR}/doc/release-notes.md" | |||||
echo "Bitcoin ABC version ${VERSION} is now available from:" > ${TOPDIR}/doc/release-notes.md | |||||
echo >> ${TOPDIR}/doc/release-notes.md | |||||
echo " <https://download.bitcoinabc.org/${VERSION}/>" >> ${TOPDIR}/doc/release-notes.md | |||||
echo >> ${TOPDIR}/doc/release-notes.md | |||||
echo "This release includes the following features and fixes:" >> ${TOPDIR}/doc/release-notes.md | |||||
# CMakeLists.txt | |||||
echo "Updating ${TOPDIR}/src/config/CMakeLists.txt" | |||||
sed -ri "s/(set\(CLIENT_VERSION_MAJOR )[[:digit:]]+/\1${MAJOR}/g" ${TOPDIR}/src/config/CMakeLists.txt | |||||
sed -ri "s/(set\(CLIENT_VERSION_MINOR )[[:digit:]]+/\1${MINOR}/g" ${TOPDIR}/src/config/CMakeLists.txt | |||||
sed -ri "s/(set\(CLIENT_VERSION_REVISION )[[:digit:]]+/\1${REVISION}/g" ${TOPDIR}/src/config/CMakeLists.txt | |||||
# gitian-OS.yml | |||||
for OS in linux osx win | |||||
do | |||||
echo "Updating ${TOPDIR}/contrib/gitian-descriptors/gitian-${OS}.yml" | |||||
sed -ri "s/(bitcoin-abc-)[[:digit:]]+\.[[:digit:]]+(-${OS})/\1${MAJOR}.${MINOR}\2/g" ${TOPDIR}/contrib/gitian-descriptors/gitian-${OS}.yml | |||||
done | |||||
echo "...done." | |||||