diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d3dc73f..d894264 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,24 +1,30 @@ +name: "Publish Python 🐍 distributions 📦 to PyPI" ---- -name: Release - -on: [push] +on: + release: + types: + - published jobs: - release: + build-n-publish-pypi: + name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + with: + fetch-depth: 0 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 - name: Install dependencies run: | - python -m pip install -U pip wheel setuptools setuptools-scm twine - - name: Build distributions + python -m pip install --upgrade pip + python -m pip install setuptools setuptools-scm wheel twine check-manifest + - name: Build a binary wheel and a source tarball run: python setup.py sdist bdist_wheel - - - name: Publish to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 with: - user: ${{ secrets.PYPI_USERNAME }} - password: ${{ secrets.PYPI_PASSWORD }} + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}