diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 40c0c6d2..b71340cd 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -43,3 +43,37 @@ jobs: run: | mamba install pytest make test + + + 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 + + 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/pyproject.toml b/pyproject.toml index bceb176e..a76e9514 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,15 +38,14 @@ test = [ "pytest", "pytest-cov", "scikit-build-core", - "nbval" - "scikit-build-core" + "nbval", ] dev = [ "pytest", "pytest-cov", "scikit-build-core", "pre-commit", - "nbval" + "nbval", ] docs = [ "Sphinx",