-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrelease.sh
executable file
·47 lines (34 loc) · 1.01 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
#!/bin/bash
# Use this script to generate a new relese
# It will create a new tag push it to github and push a source distribution to pypi
# Bail immediately if anything fails
set -Eeuo pipefail
pip install bumpversion twine
release_level=${1}
if [ "${release_level}" == "major" ] ||\
[ "${release_level}" == "minor" ] ||\
[ "${release_level}" == "patch" ]
then
bump_args="--list ${release_level}"
elif [ ! -z "${release_level}" ]
then
bump_args="--list --new-version=${release_level} patch"
else
echo "Specify major, minor or patch"
exit 1
fi
git checkout master
git pull
#python setup.py test
# First bump a new version - this creates a new git tag
new_version="$(bumpversion --tag ${bump_args} | awk -F '=' '/new_version/ {print $2}')"
# Commit the tag
git push origin v"${new_version}"
rm -rf dist/*
# Build source distribution
python setup.py sdist
python setup.py bdist_wheel
# Upload to pypi
twine upload dist/*
# Build a package using autopkg
autopkg run --verbose -d autopkg-recipe git2jss.pkg