From 7c7d36b1ce424a5c722e65ff226d643e5057b7d8 Mon Sep 17 00:00:00 2001 From: Curve Date: Tue, 16 Jul 2024 17:04:34 +0200 Subject: [PATCH] feat: add automatic publishing --- .github/workflows/python.yml | 29 ++++++++++++++++++++++++++++- pyproject.toml | 3 +-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a58f4eb1..5d117bb0 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,9 +1,16 @@ name: 🐍 Bindings on: + release: + types: + - published push: pull_request: workflow_dispatch: + inputs: + publish: + type: boolean + description: Publish on PyPi jobs: test-bindings: @@ -119,5 +126,25 @@ jobs: - name: 📦 Upload Artifact uses: actions/upload-artifact@v4 with: - name: Wheels (${{ matrix.os }}) + name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl + + deploy: + if: ${{ github.event_name == 'release' }} || ${{ github.event.inputs.publish == 'true' }} + needs: [package] + + runs-on: ubuntu-latest + name: "🐍 Publish Bindings" + + steps: + - name: 📦 Download Wheels + uses: actions/download-artifact@v4 + with: + pattern: wheels-* + path: wheels + merge-multiple: true + + - name: 🚀 Publish Wheels + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index fb32279c..d78eaf3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,11 +4,10 @@ build-backend = "scikit_build_core.build" [project] version = "4.0.0" -name = "ViennaLS_Python" +name = "ViennaLS" readme = "README.md" license = {file = "LICENSE"} description = "A high performance sparse level set library" -# dependencies = ['vtk >= 9.0.0, < 10'] [project.urls] Homepage = "https://viennatools.github.io/ViennaLS/"