diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 56811684..8b7e0ff1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -762,6 +762,29 @@ jobs: with: name: ${{ github.job }}-checkpoint.tar.xz path: ${{ github.workspace }}/artifacts/checkpoint.tar.xz + twine-upload-training: + name: "Upload STT training packages to PyPI" + runs-on: ubuntu-20.04 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Update pip and install deps + run: | + python -m pip install -U pip setuptools twine build + - run: | + python -m build + - name: Setup PyPI config + run: | + cat << EOF > ~/.pypirc + [pypi] + username=__token__ + password=${{ secrets.PYPI_TRAINING_TOKEN }} + EOF + - run: | + twine upload --repository pypi dist/* twine-upload-stt: name: "Upload STT packages to PyPI" runs-on: ubuntu-20.04 diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..aad17fa0 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include training/coqui_stt_training/VERSION +include training/coqui_stt_training/GRAPH_VERSION diff --git a/setup.py b/setup.py index 93cdf094..9d850c58 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import find_packages, setup def main(): - version_file = Path(__file__).parent / "VERSION" + version_file = Path(__file__).parent / "training" / "coqui_stt_training" / "VERSION" with open(str(version_file)) as fin: version = fin.read().strip() @@ -68,14 +68,7 @@ def main(): packages=find_packages(where="training"), python_requires=">=3.5, <4", install_requires=install_requires, - # If there are data files included in your packages that need to be - # installed, specify them here. - package_data={ - "coqui_stt_training": [ - "VERSION", - "GRAPH_VERSION", - ], - }, + include_package_data=True, )