From 9117f96aa8e354071087e8a5fe8a7d93051d6d5f Mon Sep 17 00:00:00 2001 From: Guillaume Gay Date: Wed, 14 Feb 2024 09:11:10 +0100 Subject: [PATCH] use pypi (#286) * use pypi * split actions * no double --- .github/workflows/pypi.yml | 24 ++++++++++++++++++++++++ .github/workflows/sdist.yml | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/pypi.yml create mode 100644 .github/workflows/sdist.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..621033d4 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,24 @@ +name: PyPi upload + +env: + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest tests" + +on: [push] + +jobs: + upload_all: + needs: [build_wheels, make_sdist] + environment: pypi + permissions: + id-token: write + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml new file mode 100644 index 00000000..2becdf1f --- /dev/null +++ b/.github/workflows/sdist.yml @@ -0,0 +1,25 @@ +name: Python Package using Conda + +env: + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest tests" + +on: [push] + +jobs: + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Optional, use if you use setuptools_scm + submodules: true # Optional, use if you have submodules + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz