-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from elyezer/release-script
Release script
- Loading branch information
Showing
11 changed files
with
117 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
sudo: false | ||
language: python | ||
install: "pip install flake8 ." | ||
install: pip install -r requirements-dev.txt . | ||
script: | ||
- flake8 testimony | ||
- make lint | ||
- make test | ||
notifications: | ||
irc: "chat.freenode.net#robottelo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
include README.rst | ||
include LICENSE | ||
include LICENSE README.rst VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
lint: | ||
flake8 testimony | ||
|
||
package: | ||
python setup.py sdist bdist_wheel --universal | ||
|
||
package-clean: | ||
rm -rf build dist testimony.egg-info | ||
|
||
publish: package | ||
twine upload dist/* | ||
test: | ||
@./tests/test_testimony.sh | diff tests/sample_output.txt - | ||
|
||
.PHONY: test | ||
.PHONY: package package-clean publish test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
# | ||
# Test Testimony for sanity. If all is well, generate a new commit, tag it, and | ||
# print instructions for further steps to take. | ||
# | ||
# NOTE: This script should be run from the repository root directory. Also in | ||
# order to actually release to PyPI a proper `.pypirc` file should be already | ||
# setup, for more information check | ||
# https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file | ||
# | ||
set -euo pipefail | ||
|
||
# Make sure local fork is updated | ||
git fetch -p --all | ||
git checkout master | ||
git merge --ff-only upstream/master | ||
|
||
OLD_VERSION="$(git tag --list | sort -V | tail -n 1)" | ||
MAJOR_VERSION="$(echo ${OLD_VERSION} | cut -d . -f 1)" | ||
MINOR_VERSION="$(echo ${OLD_VERSION} | cut -d . -f 2)" | ||
NEW_VERSION="${MAJOR_VERSION}.$((${MINOR_VERSION} + 1)).0" | ||
|
||
# Bump version number | ||
echo "${NEW_VERSION}" > VERSION | ||
|
||
# Generate the package | ||
make package-clean package | ||
|
||
# Sanity check Testimony packages on both Python 2 and Python 3 | ||
for python in python{2,3}; do | ||
venv="$(mktemp --directory)" | ||
virtualenv -p "${python}" "${venv}" | ||
set +u | ||
source "${venv}/bin/activate" | ||
set -u | ||
for dist in dist/*; do | ||
ls "${dist}" | ||
pip install --quiet -U pip | ||
pip install --quiet "${dist}" | ||
python -c "import testimony" 1>/dev/null | ||
make test | ||
pip uninstall --quiet --yes testimony | ||
done | ||
set +u | ||
deactivate | ||
set -u | ||
rm -rf "${venv}" | ||
done | ||
|
||
# Get the changes from last release and commit | ||
git add VERSION | ||
git commit -m "Release version ${NEW_VERSION}" \ | ||
-m "Shortlog of commits since last release:" \ | ||
-m "$(git shortlog ${OLD_VERSION}.. | sed 's/^./ &/')" | ||
|
||
# Tag with the new version | ||
git tag "${NEW_VERSION}" | ||
|
||
fmt <<EOF | ||
This script has made only local changes: it has updated the VERSION file, | ||
generated a new commit, tagged the new commit, and performed a few checks along | ||
the way. If you are confident in these changes, you can publish them with | ||
commands like the following: | ||
EOF | ||
|
||
cat <<EOF | ||
git push --tags origin master && git push --tags upstream master | ||
make publish | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# For `make lint` | ||
flake8 | ||
flake8-docstrings | ||
flake8-quotes | ||
|
||
# For `make package` | ||
wheel | ||
|
||
# For `make publish` | ||
twine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
from distutils.core import setup | ||
from setuptools import find_packages, setup # prefer setuptools over distutils | ||
|
||
with open('LICENSE') as file: | ||
license = file.read() | ||
|
||
with open('README.rst') as file: | ||
long_description = file.read() | ||
|
||
with open('VERSION') as file: | ||
version = file.read() | ||
|
||
setup( | ||
name='testimony', | ||
version='1.0.6', | ||
version=version, | ||
url='https://github.com/SatelliteQE/testimony/', | ||
author='Suresh Thirugn', | ||
author_email='[email protected]', | ||
packages=['testimony'], | ||
packages=find_packages(), | ||
install_requires=['Click'], | ||
entry_points=''' | ||
[console_scripts] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters