Skip to content

Commit 1b1a9a8

Browse files
committed
add bash script to update version
1 parent 8353826 commit 1b1a9a8

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

scripts/ci/version.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
# Update the version strings in the source code
4+
5+
# Input:
6+
# $1 - the version string, if omitted, use ${!BUILD_BUILDID}
7+
8+
version=$1
9+
10+
if [ -z ${version} ]; then
11+
version=${!BUILD_BUILDID}
12+
fi
13+
14+
if [ -z ${version} ]; then
15+
echo 'Missing version string'
16+
exit 1
17+
fi
18+
19+
echo "Replace with version: $version"
20+
21+
platform=`uname`
22+
23+
for each in $(find . -name setup.py); do
24+
if [ "$platform" == "Darwin" ]; then
25+
sed -i "" "s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" ${each}
26+
else
27+
sed -i "s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" ${each}
28+
fi
29+
done
30+
31+
for each in $(find . -name version.py); do
32+
if [ "$platform" == "Darwin" ]; then
33+
sed -i "" "s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" ${each}
34+
else
35+
sed -i "s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" ${each}
36+
fi
37+
done

vsts/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from setuptools import setup, find_packages
77

88
NAME = "vsts"
9-
VERSION = "0.1.0-beta+dev"
9+
VERSION = "0.1.0b"
1010

1111
# To install the library, run the following
1212
#

vsts/vsts/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
VERSION = "0.1.0-beta+dev"
6+
VERSION = "0.1.0b"

0 commit comments

Comments
 (0)