diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..41c7202 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,39 @@ +# This workflow will release to PyPi + +name: Release to PyPi + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build and check Python distributions + run: | + python setup.py sdist bdist_wheel + twine check dist/* + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1