mirror of https://github.com/coqui-ai/TTS.git
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
name: Publish Python 🐍 distributions 📦 to PyPI
|
|
on:
|
|
release:
|
|
types: [published]
|
|
defaults:
|
|
run:
|
|
shell:
|
|
bash
|
|
jobs:
|
|
build-sdist:
|
|
name: Build source distribution
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Verify tag matches version
|
|
run: |
|
|
set -ex
|
|
version=$(grep -m 1 version pyproject.toml | grep -P '\d+\.\d+\.\d+' -o)
|
|
tag="${GITHUB_REF/refs\/tags\/}"
|
|
if [[ "v$version" != "$tag" ]]; then
|
|
exit 1
|
|
fi
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.9
|
|
- run: |
|
|
python -m pip install -U pip setuptools build
|
|
- run: |
|
|
python -m build
|
|
- run: |
|
|
pip install dist/*.tar.gz
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-sdist
|
|
path: dist/*.tar.gz
|
|
build-wheels:
|
|
name: Build wheels on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.21.1
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-wheels-${{ matrix.os }}
|
|
path: ./wheelhouse/*.whl
|
|
publish-artifacts:
|
|
name: Publish to PyPI
|
|
runs-on: ubuntu-latest
|
|
needs: [build-sdist, build-wheels]
|
|
environment:
|
|
name: release
|
|
url: https://pypi.org/p/coqui-tts
|
|
permissions:
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: dist
|
|
pattern: build-*
|
|
merge-multiple: true
|
|
- run: |
|
|
ls -lh dist/
|
|
- name: Publish package distributions to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|