diff options
Diffstat (limited to 'update_version.sh')
-rwxr-xr-x | update_version.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 000000000000..c0c55144aa5c --- /dev/null +++ b/update_version.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -euxo pipefail + +REPO="https://github.com/yggdrasil-network/yggdrasil-go.git" +WORKDIR="/tmp/yggdrasil-go" + +# Set up cleanup +function cleanup() { + rm -rf ${WORKDIR} +} +trap cleanup EXIT + +# Check out latest master +git clone ${REPO} ${WORKDIR} + +# Fetch version information +pushd ${WORKDIR} +VER=$(bash contrib/semver/version.sh | sed 's/^v//') + +# Replace version in PKGBUILD +popd +sed -i "s/^pkgver=.*$/pkgver=${VER}/" PKGBUILD + +# Check for real updates +if (git diff --exit-code PKGBUILD); then + echo "Version ${VER} is already in PKGBUILD, not updating" + exit 0 +fi + +# Update .SRCINFO +makepkg --printsrcinfo >.SRCINFO + +# Create update-commit +git add PKGBUILD .SRCINFO +git commit -m "yggdrasil-go v${VER}" |