mirror of https://github.com/coqui-ai/TTS.git
ci(pypi-release): update actions, use trusted publishing
https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
This commit is contained in:
parent
d772724125
commit
7fe6a01120
|
@ -10,7 +10,7 @@ jobs:
|
||||||
build-sdist:
|
build-sdist:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Verify tag matches version
|
- name: Verify tag matches version
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
|
@ -19,7 +19,7 @@ jobs:
|
||||||
if [[ "v$version" != "$tag" ]]; then
|
if [[ "v$version" != "$tag" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
- run: |
|
- run: |
|
||||||
|
@ -28,7 +28,7 @@ jobs:
|
||||||
python -m build
|
python -m build
|
||||||
- run: |
|
- run: |
|
||||||
pip install dist/*.tar.gz
|
pip install dist/*.tar.gz
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sdist
|
name: sdist
|
||||||
path: dist/*.tar.gz
|
path: dist/*.tar.gz
|
||||||
|
@ -38,8 +38,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.9", "3.10", "3.11"]
|
python-version: ["3.9", "3.10", "3.11"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install pip requirements
|
- name: Install pip requirements
|
||||||
|
@ -50,45 +50,38 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
python setup.py bdist_wheel --plat-name=manylinux1_x86_64
|
python setup.py bdist_wheel --plat-name=manylinux1_x86_64
|
||||||
python -m pip install dist/*-manylinux*.whl
|
python -m pip install dist/*-manylinux*.whl
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: wheel-${{ matrix.python-version }}
|
name: wheel-${{ matrix.python-version }}
|
||||||
path: dist/*-manylinux*.whl
|
path: dist/*-manylinux*.whl
|
||||||
publish-artifacts:
|
publish-artifacts:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: [build-sdist, build-wheels]
|
needs: [build-sdist, build-wheels]
|
||||||
|
environment:
|
||||||
|
name: release
|
||||||
|
url: https://pypi.org/p/coqui-tts
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
mkdir dist
|
mkdir dist
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "sdist"
|
name: "sdist"
|
||||||
path: "dist/"
|
path: "dist/"
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "wheel-3.9"
|
name: "wheel-3.9"
|
||||||
path: "dist/"
|
path: "dist/"
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "wheel-3.10"
|
name: "wheel-3.10"
|
||||||
path: "dist/"
|
path: "dist/"
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "wheel-3.11"
|
name: "wheel-3.11"
|
||||||
path: "dist/"
|
path: "dist/"
|
||||||
- run: |
|
- run: |
|
||||||
ls -lh dist/
|
ls -lh dist/
|
||||||
- name: Setup PyPI config
|
- name: Publish package distributions to PyPI
|
||||||
run: |
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
cat << EOF > ~/.pypirc
|
|
||||||
[pypi]
|
|
||||||
username=__token__
|
|
||||||
password=${{ secrets.PYPI_TOKEN }}
|
|
||||||
EOF
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
- run: |
|
|
||||||
python -m pip install twine
|
|
||||||
- run: |
|
|
||||||
twine upload --repository pypi dist/*
|
|
||||||
|
|
Loading…
Reference in New Issue