Skip to content

Commit

Permalink
Merge pull request #987 from unclejack/prepare_for_1.1.3
Browse files Browse the repository at this point in the history
prepare for 1.1.3 & bump version to 1.1.3
  • Loading branch information
dseevr authored Sep 29, 2017
2 parents 48a0e6d + 52681cf commit 7d6b704
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ clean-tar:

# GITHUB_USER and GITHUB_TOKEN are needed be set to run github-release
release: tar
TAR_FILENAME=$(TAR_FILENAME) TAR_FILE=$(TAR_FILE) VERSION=$(VERSION) \
TAR_FILENAME=$(TAR_FILENAME) TAR_FILE=$(TAR_FILE) \
OLD_VERSION=${OLD_VERSION} BUILD_VERSION=${BUILD_VERSION} \
USE_RELEASE=${USE_RELEASE} scripts/release.sh
@make clean-tar

50 changes: 29 additions & 21 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash

set -euo pipefail

if [ -z "${VERSION-}" ]; then
echo "VERSION needs to be defined to make a release"
# Assumes following variables to be defined:
# OLD_VERSION - previous version against which to create changelog
# BUILD_VERSION - new version being released
# GITHUB_USER - contiv
# GITHUB_TOKEN - your github token
# USE_RELEASE - if 0 or not set, will make a pre-release

if [ -z "$(which github-release)" ]; then
echo "Please install github-release before running this script"
echo "You may download a release from https://github.com/aktau/github-release/releases or run 'go get github.com/aktau/github-release' if you have Go installed"
exit 1
fi


if [ -z "${TAR_FILENAME-}" ]; then
echo "TAR_FILENAME needs to be defined to make a release"
exit 1
Expand All @@ -17,20 +23,22 @@ if [ ! -f "$TAR_FILE" ]; then
exit 1
fi

if [ -n "$USE_RELEASE" ]; then
if [ -z "$OLD_VERSION" ]; then
echo "A release requires OLD_VERSION to be defined"
exit 1
fi
if [ "$OLD_VERSION" != "none" ]; then
comparison="$OLD_VERSION..HEAD"
fi
pre_release=""
else
latest_tag=$(git tag | egrep -v "^v" | grep UTC | sort -V | tail -1)
if [ -z "$BUILD_VERSION" ]; then
echo "A release requires BUILD_VERSION to be defined"
exit 1
fi

if [ -z "$OLD_VERSION" ]; then
echo "A release requires OLD_VERSION to be defined"
exit 1
fi

if [ "$OLD_VERSION" != "none" ]; then
comparison="$OLD_VERSION..HEAD"
fi

comparison="$latest_tag..HEAD"
echo "Making a pre-release..."
if [ "$USE_RELEASE" != "1" ]; then
echo "Making a pre-release.."
pre_release="-p"
fi

Expand All @@ -46,6 +54,6 @@ else
fi

set -x
( (github-release -v release $pre_release -r netplugin -t $VERSION -d "**Changelog**<br/>$changelog") \
&& (github-release -v upload -r netplugin -t $VERSION -n $TAR_FILENAME -f $TAR_FILE \
|| github-release -v delete -r netplugin -t $VERSION)) || exit 1
( (github-release -v release $pre_release -r netplugin -t $BUILD_VERSION -d "**Changelog**<br/>$changelog") \
&& (github-release -v upload -r netplugin -t $BUILD_VERSION -n $TAR_FILENAME -f $TAR_FILE \
|| github-release -v delete -r netplugin -t $BUILD_VERSION)) || exit 1
2 changes: 1 addition & 1 deletion version/CURRENT_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.2
1.1.3

0 comments on commit 7d6b704

Please sign in to comment.