-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·52 lines (39 loc) · 1.11 KB
/
release.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
VERSION=${1}
if [ -z "${VERSION}" ];
then
echo "Usage: $0 [VERSION]"
exit 1
fi
echo "Releasing version ${VERSION}."
read -n1 -rsp $'Click any key to continue or Ctrl+C to exit...\n' key
if [ "$key" = '' ]; then
git flow release start ${VERSION}
if [ $? -ne 0 ]; then
echo "Error running git flow release start ${VERSION}"
exit 1
fi
result=`emacs pyproject.toml lgw/version.py tests/test_lgw.py`
if [ ${result} ];
then
echo 'Error bumping version, aborting.'
exit 1
fi
git add pyproject.toml lgw/version.py tests/test_lgw.py
if [ $? -ne 0 ]; then
echo "Error adding pyproject.toml, lgw/version.py and tests/test_lgw.py"
exit 1
fi
git commit --gpg-sign --message 'bump version'
if [ $? -ne 0 ]; then
echo "Error committing"
exit 1
fi
pypi_username=$(cat ~/.pypirc | grep username | awk '{ print $3 }')
pypi_password=$(cat ~/.pypirc | grep password | awk '{ print $3 }')
poetry publish --build --username="${pypi_username}" --password="${pypi_password}"
git flow release finish ${VERSION}
else
echo 'Release cancelled.'
exit 1
fi