name: PyPi on: push: branches: - '**' tags: - 'v*.*.*' pull_request: jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-18.04 steps: - uses: actions/checkout@master - name: Set up Python 3.9 uses: actions/setup-python@v1 with: python-version: 3.9 - name: Install dependencies and build run: | python -m pip install --upgrade pip pip install setuptools wheel twine python setup.py sdist bdist_wheel - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.PYPI_API_TOKEN }}