diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e16c1ef..162fa5c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -9,8 +9,8 @@ on: push jobs: - build-n-publish: - name: Build and publish to PyPI + build: + name: Build package runs-on: ubuntu-latest steps: - name: Checkout code @@ -26,12 +26,30 @@ jobs: - name: Build package run: | python -m build + - name: Upload dist files + uses: actions/upload-artifact@v2 + with: + name: dist-files + path: dist/ + if-no-files-found: error + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + needs: build-n-publish + steps: + - name: Download dist files + uses: actions/download-artifact@v2 + with: + name: dist-files + path: dist/ - name: Publish package to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: + user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - name: Publish package to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: + user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}