From 9b6f971366a9dd4e3caba4a14cdfd7cc75fae63b Mon Sep 17 00:00:00 2001 From: kklein Date: Thu, 4 Jul 2024 13:33:03 +0200 Subject: [PATCH] Draft usage of PyPI action. --- .github/workflows/package.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index cf80373..649617b 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -12,7 +12,26 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v4 + - name: Set up pixi + uses: prefix-dev/setup-pixi@v0.8.1 + - name: Build + run: | + pixi run python -m build + - uses: actions/upload-artifact@v4 with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - # TODO: Build and upload to PyPI. + path: dist/* + + upload_pypi: + name: Upload to PyPI + needs: [build_artifacts] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + name: artifact + path: dist + - uses: pypa/gh-action-pypi-publish@v1.9.0 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }}