Skip to content

Commit 7d6b704

Browse files
authored
Merge pull request #987 from unclejack/prepare_for_1.1.3
prepare for 1.1.3 & bump version to 1.1.3
2 parents 48a0e6d + 52681cf commit 7d6b704

File tree

3 files changed

+31
-24
lines changed

3 files changed

+31
-24
lines changed

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ clean-tar:
333333

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

scripts/release.sh

+29-21
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/bash
2-
3-
set -euo pipefail
4-
5-
if [ -z "${VERSION-}" ]; then
6-
echo "VERSION needs to be defined to make a release"
2+
# Assumes following variables to be defined:
3+
# OLD_VERSION - previous version against which to create changelog
4+
# BUILD_VERSION - new version being released
5+
# GITHUB_USER - contiv
6+
# GITHUB_TOKEN - your github token
7+
# USE_RELEASE - if 0 or not set, will make a pre-release
8+
9+
if [ -z "$(which github-release)" ]; then
10+
echo "Please install github-release before running this script"
11+
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"
712
exit 1
813
fi
914

15+
1016
if [ -z "${TAR_FILENAME-}" ]; then
1117
echo "TAR_FILENAME needs to be defined to make a release"
1218
exit 1
@@ -17,20 +23,22 @@ if [ ! -f "$TAR_FILE" ]; then
1723
exit 1
1824
fi
1925

20-
if [ -n "$USE_RELEASE" ]; then
21-
if [ -z "$OLD_VERSION" ]; then
22-
echo "A release requires OLD_VERSION to be defined"
23-
exit 1
24-
fi
25-
if [ "$OLD_VERSION" != "none" ]; then
26-
comparison="$OLD_VERSION..HEAD"
27-
fi
28-
pre_release=""
29-
else
30-
latest_tag=$(git tag | egrep -v "^v" | grep UTC | sort -V | tail -1)
26+
if [ -z "$BUILD_VERSION" ]; then
27+
echo "A release requires BUILD_VERSION to be defined"
28+
exit 1
29+
fi
30+
31+
if [ -z "$OLD_VERSION" ]; then
32+
echo "A release requires OLD_VERSION to be defined"
33+
exit 1
34+
fi
35+
36+
if [ "$OLD_VERSION" != "none" ]; then
37+
comparison="$OLD_VERSION..HEAD"
38+
fi
3139

32-
comparison="$latest_tag..HEAD"
33-
echo "Making a pre-release..."
40+
if [ "$USE_RELEASE" != "1" ]; then
41+
echo "Making a pre-release.."
3442
pre_release="-p"
3543
fi
3644

@@ -46,6 +54,6 @@ else
4654
fi
4755

4856
set -x
49-
( (github-release -v release $pre_release -r netplugin -t $VERSION -d "**Changelog**<br/>$changelog") \
50-
&& (github-release -v upload -r netplugin -t $VERSION -n $TAR_FILENAME -f $TAR_FILE \
51-
|| github-release -v delete -r netplugin -t $VERSION)) || exit 1
57+
( (github-release -v release $pre_release -r netplugin -t $BUILD_VERSION -d "**Changelog**<br/>$changelog") \
58+
&& (github-release -v upload -r netplugin -t $BUILD_VERSION -n $TAR_FILENAME -f $TAR_FILE \
59+
|| github-release -v delete -r netplugin -t $BUILD_VERSION)) || exit 1

version/CURRENT_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.2
1+
1.1.3

0 commit comments

Comments
 (0)