-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·33 lines (27 loc) · 851 Bytes
/
release.sh
File metadata and controls
executable file
·33 lines (27 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
__base="$(basename ${__file} .sh)"
__root="$(cd "$(dirname "${__dir}")" && pwd)" # <-- change this as it depends on your app
SEMVER="${1:-}"
releaseBranch=release-${SEMVER}
init_py=tf_image_classification/__init__.py
sed_param="s/\${VERSION}/${SEMVER}/"
if [[ -z $(git status -s) ]]
then
echo "tree is clean"
git checkout -b ${releaseBranch}
sed -e "${sed_param}" -i ${init_py}
git commit -am "Releasing ${SEMVER}"
git tag ${SEMVER}
git push origin --tags
else
echo "Tree is dirty, please commit changes before running this."
exit
fi