Skip to content

Commit

Permalink
Add automatic PyPI deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Olof Kraigher committed Jul 10, 2017
1 parent 35fdc4d commit d4470e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,19 @@ matrix:
skip_cleanup: true
on:
branch: master

# Deploy to PyPI whenever the package version has changed
# When a package version has not changed a new upload will not be triggered
- stage: deploy
python: '3.6'
script:
- sed -i "s/PRE_RELEASE = True/PRE_RELEASE = False/" vunit/about.py
deploy:
provider: pypi
distributions: sdist
skip_cleanup: true
skip_upload_docs: true
user: $PYPI_USER
password: $PYPI_PASSWORD
on:
branch: master
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def find_all_files(directory, endings=None):
ending = os.path.splitext(filename)[-1]
if endings is None or ending in endings:
result.append(os.path.join(root, filename))
else:
print("Ignoring %s" % filename)
return result

data_files = []
Expand Down
6 changes: 4 additions & 2 deletions vunit/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ def version():
Returns VUnit version
"""
if PRE_RELEASE:
return '%i.%i.%i-pre' % (VERSION[0], VERSION[1], VERSION[2] + 1)
return '%i.%i.%irc0' % (VERSION[0], VERSION[1], VERSION[2] + 1)

return '%i.%i.%i' % (VERSION[0], VERSION[1], VERSION[2])


VERSION = (2, 0, 0)
PRE_RELEASE = True # Only set to True in release tags

# DO NOT TOUCH: Only set to False by PyPI deployment script
PRE_RELEASE = True

0 comments on commit d4470e5

Please sign in to comment.