Set it to release only

This commit is contained in:
WeberJulian 2022-06-30 13:51:41 +02:00
parent 99f6b9c920
commit ae364e5b12
1 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,5 @@
name: Publish Python 🐍 distributions 📦 to PyPI name: Publish Python 🐍 distributions 📦 to PyPI
on: on:
pull_request:
release: release:
types: [published] types: [published]
defaults: defaults:
@ -10,7 +9,15 @@ defaults:
jobs: jobs:
build-sdist: build-sdist:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: #Add back version test steps:
- name: Verify tag matches version
run: |
set -ex
version=$(cat TTS/VERSION)
tag="${GITHUB_REF/refs\/tags\/}"
if [[ "v$version" != "$tag" ]]; then
exit 1
fi
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Verify tag matches version - name: Verify tag matches version
run: | run: |
@ -83,9 +90,9 @@ jobs:
- name: Setup PyPI config - name: Setup PyPI config
run: | run: |
cat << EOF > ~/.pypirc cat << EOF > ~/.pypirc
[testpypi] [pypi]
username=__token__ username=__token__
password=${{ secrets.TEST_PYPI_TOKEN }} password=${{ secrets.PYPI_TOKEN }}
EOF EOF
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
@ -93,4 +100,4 @@ jobs:
- run: | - run: |
python -m pip install twine python -m pip install twine
- run: | - run: |
twine upload --repository testpypi dist/* twine upload --repository pypi dist/*