ipfs-cluster/release.sh

41 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
# Updates the Version variables, commits, tags and signs
2020-05-19 08:08:09 +00:00
set -eux
version="$1"
if [ -z $version ]; then
echo "Need a version!"
exit 1
fi
2019-04-10 09:59:22 +00:00
make clean
sed -i "s/Version = semver\.MustParse.*$/Version = semver.MustParse(\"$version\")/" version/version.go
sed -i "s/const Version.*$/const Version = \"$version\"/" cmd/ipfs-cluster-ctl/main.go
2020-05-19 08:08:09 +00:00
git add version/version.go cmd/ipfs-cluster-ctl/main.go
# Dev versions, just commit
if [[ "$version" == *"-dev" ]]; then
git commit -S -m "Set development version v${version}"
exit 0
fi
# RC versions, commit and make a non-annotated tag.
if [[ "$version" == *"-dev" ]]; then
git commit -S -m "Release candidate v${version}"
git tag -s "v${version}"
exit 0
fi
# Actual releases, commit and make an annotated tag with all the commits
# since the last.
git commit -S -m "Release v${version}"
lastver=`git describe`
echo "Tag for Release ${version}" > tag_annotation
echo >> tag_annotation
git log --pretty=oneline ${lastver}..HEAD >> tag_annotation
2020-05-19 08:08:09 +00:00
git tag -a -s -F tag_annotation "v${version}"
rm tag_annotation