From 45ce88ac065ff10ce443abcd0b13e7851387227d Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Wed, 11 Sep 2024 13:57:04 +0200 Subject: [PATCH 1/2] feat(ci): publish sdist to PyPI as well closes #283 Signed-off-by: Luka Peschke --- .github/workflows/CI.yml | 15 +++++++++++++++ .github/workflows/release.yml | 29 +++++++++++++++++++++++++++-- Cargo.toml | 11 +++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0588e9f..96226c0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -144,3 +144,18 @@ jobs: with: name: "wheels-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ matrix.architecture }}" path: dist + + check-sdist-build: + runs-on: "ubuntu-latest" + steps: + - name: build sdist + uses: messense/maturin-action@v1 + with: + manylinux: auto + command: sdist + args: "-o dist" + - name: upload sdist + uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67d3aa4..f30a58e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,11 +67,28 @@ jobs: name: "wheels-windows-python-${{ matrix.python-version }}" path: dist + sdist: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v4 + - name: build (sdist) + uses: messense/maturin-action@v1 + with: + manylinux: auto + command: sdist + args: "-o dist" + - name: Upload sdist + uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist + + # NOTE: Cannot use a matrix here, as we only want a single release release: name: Release runs-on: ubuntu-latest - needs: [linux, macos, windows] + needs: [linux, macos, windows, sdist] steps: - name: Download Linux 3.8 wheels for x86-64 uses: actions/download-artifact@v4 @@ -103,13 +120,20 @@ jobs: name: "wheels-windows-python-3.8" path: wheels-windows + - name: Download sdist + uses: actions/download-artifact@v4 + with: + name: "sdist" + path: sdist + + - name: Publish to PyPI uses: messense/maturin-action@v1 env: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: command: upload - args: "--skip-existing wheels-linux/*.whl wheels-macos/*.whl wheels-windows/*.whl" + args: "--skip-existing wheels-linux/*.whl wheels-macos/*.whl wheels-windows/*.whl sdist/*.tar.gz" - name: Release uses: softprops/action-gh-release@v2 @@ -119,3 +143,4 @@ jobs: wheels-linux/*.whl wheels-macos/*.whl wheels-windows/*.whl + sdist/*.tag.gz diff --git a/Cargo.toml b/Cargo.toml index fc5331e..38c5013 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,17 @@ name = "fastexcel" version = "0.11.6" edition = "2021" +include = [ + "/pyproject.toml", + "/README.md", + "/LICENSE", + "/Makefile", + "/src", + "/python/fastexcel", + "!__pycache__", + "!*.pyc", + "!*.so", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] From e87dc470c381e3c5c18c5b5bffd58f80b9cb300e Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Wed, 11 Sep 2024 13:59:42 +0200 Subject: [PATCH 2/2] fix: add missing checkout step Signed-off-by: Luka Peschke --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 96226c0..137d7eb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -148,6 +148,7 @@ jobs: check-sdist-build: runs-on: "ubuntu-latest" steps: + - uses: actions/checkout@v4 - name: build sdist uses: messense/maturin-action@v1 with: