Skip to content

Commit

Permalink
Merge pull request #9 from coqui-ai/release-ci
Browse files Browse the repository at this point in the history
Upload to PyPI on release
  • Loading branch information
reuben authored May 20, 2021
2 parents 247477d + 91ba147 commit 41a2423
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PyPI publish on release
on:
release:
types: [published]
defaults:
run:
shell:
bash
jobs:
build-package:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Verify tag matches version
run: |
set -ex
version=$(cat VERSION)
tag="${GITHUB_REF/refs\/tags\/}"
if [[ "v$version" != "$tag" ]]; then
exit 1
fi
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: |
python -m pip install -U pip setuptools twine
- run: |
python setup.py sdist
- name: Setup PyPI config
run: |
cat << EOF > ~/.pypirc
[pypi]
username=__token__
password=${{ secrets.PYPI_TOKEN }}
EOF
- run: |
twine upload --repository testpypi dist/*.tar.gz
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include VERSION
include README.md
include LICENSE.txt
include requirements*.txt
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.7
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import setuptools.command.develop
from setuptools import find_packages, setup

version = "0.0.7"
cwd = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(cwd, "VERSION")) as fin:
version = fin.read().strip()


class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
Expand Down

0 comments on commit 41a2423

Please sign in to comment.