diff --git a/.github/workflows/to_pypi.yml b/.github/workflows/to_pypi.yml index 910a7c7..bc94cf0 100644 --- a/.github/workflows/to_pypi.yml +++ b/.github/workflows/to_pypi.yml @@ -1,30 +1,51 @@ -name: Upload to PyPI +name: Publish to PyPI on: release: types: created jobs: - upload-to-pypi: + build: + name: Build distribution runs-on: ubuntu-latest + steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ - - name: Install pypa/build - run: >- - python -m pip install build --user + publish-to-pypi: + name: >- + Publish distribution to PyPI + needs: + - build + runs-on: ubuntu-latest - - name: Build a binary wheel and a source tarball - run: >- - python -m build --sdist --wheel --outdir dist/ + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true + skip_existing: true - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - verbose: true - skip_existing: true \ No newline at end of file