From 0ccd09f0798f9b87bdca7b8903741e803af8bb62 Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Thu, 8 Jan 2026 10:57:50 +0100 Subject: [PATCH] - publish to pypi using github action --- .github/workflows/publish.yml | 50 +++++++++++++++++++++++++++++++++++ .github/workflows/pytest.yml | 22 --------------- 2 files changed, 50 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..96000b1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,50 @@ +name: Publish + +on: [push, pull_request, workflow_call] + +permissions: + contents: read + +jobs: + pytest: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [ "3.10", "3.12" ] + os: [ ubuntu-latest, windows-latest, macOS-latest ] + + steps: + - uses: actions/checkout@v6 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - name: Install + run: pip install .[test] + - name: Test with pytest + run: pytest + + sdist: + needs: [ pytest ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + - name: Upload sdist + uses: actions/upload-artifact@v6 + with: + name: wheels-sdist + path: dist + + release: + name: Release + runs-on: ubuntu-latest + needs: [ sdist ] + steps: + - uses: actions/download-artifact@v7 + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml deleted file mode 100644 index 1451798..0000000 --- a/.github/workflows/pytest.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: PyTest - -on: [push, pull_request] - -jobs: - pytest: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ["3.10", "3.12"] - os: [ubuntu-latest, windows-latest, macOS-latest] - - steps: - - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: Install - run: pip install .[test] - - name: Test with pytest - run: pytest \ No newline at end of file