diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c270334..422650e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -83,6 +83,31 @@ jobs: name: wheels-${{ matrix.os }} path: wheelhouse + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: 'da-wad/zfp' + ref: '1.0.1' + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install build dependencies + run: python -m pip install build + + - name: Build sdist + run: python -m build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist + # upload weels as a single artefact upload-wheels: needs: build_wheels @@ -95,20 +120,40 @@ jobs: pattern: wheels-* separate-directories: false delete-merged: false + + # upload sdist as a single artifact + upload-sdist: + needs: build_sdist + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: sdist + path: sdist + + - uses: actions/upload-artifact@v4 + with: + name: sdist-final + path: sdist publish: - needs: upload-wheels + needs: [upload-wheels, upload-sdist] name: Publish wheels to PyPI runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 with: name: wheels - path: wheelhouse + path: dist + + - uses: actions/download-artifact@v4 + with: + name: sdist-final + path: dist - - name: Publish wheels to PyPI + - name: Publish wheels and sdist to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} - packages-dir: wheelhouse + packages-dir: dist skip-existing: true