From f213fe3dfa241d76fd6dcf4fad13176d203d8ac3 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 19 May 2020 10:08:09 +0200 Subject: [PATCH] Set development version v0.13.0-dev --- cmd/ipfs-cluster-ctl/main.go | 2 +- release.sh | 28 ++++++++++++++++++++++------ version/version.go | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/cmd/ipfs-cluster-ctl/main.go b/cmd/ipfs-cluster-ctl/main.go index 48e35b78..a3670738 100644 --- a/cmd/ipfs-cluster-ctl/main.go +++ b/cmd/ipfs-cluster-ctl/main.go @@ -28,7 +28,7 @@ const programName = `ipfs-cluster-ctl` // Version is the cluster-ctl tool version. It should match // the IPFS cluster's version -const Version = "0.13.0" +const Version = "0.13.0-dev" var ( defaultHost = "/ip4/127.0.0.1/tcp/9094" diff --git a/release.sh b/release.sh index 31de4f50..66b3bb3c 100755 --- a/release.sh +++ b/release.sh @@ -2,8 +2,7 @@ # Updates the Version variables, commits, tags and signs -set -e -set -x +set -eux version="$1" @@ -15,10 +14,27 @@ fi 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 -git commit -S -a -m "Release $version" -lastver=`git tag -l | grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' | tail -n 1` +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 -git tag -a -s -F tag_annotation v$version -rm tag_annotation \ No newline at end of file +git tag -a -s -F tag_annotation "v${version}" +rm tag_annotation diff --git a/version/version.go b/version/version.go index f06ec7fa..5acf8104 100644 --- a/version/version.go +++ b/version/version.go @@ -6,7 +6,7 @@ import ( ) // Version is the current cluster version. -var Version = semver.MustParse("0.13.0") +var Version = semver.MustParse("0.13.0-dev") // RPCProtocol is protocol handler used to send libp2p-rpc messages between // cluster peers. All peers in the cluster need to speak the same protocol