Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): publish sdist to PyPI as well #284

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,19 @@ jobs:
with:
name: "wheels-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ matrix.architecture }}"
path: dist

check-sdist-build:
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
29 changes: 27 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -119,3 +143,4 @@ jobs:
wheels-linux/*.whl
wheels-macos/*.whl
wheels-windows/*.whl
sdist/*.tag.gz
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
name = "fastexcel"
version = "0.11.6"
edition = "2021"
include = [
"/pyproject.toml",
"/README.md",
"/LICENSE",
"/Makefile",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, otherwise everything gets included by default and we end up with a 50mb sdist 😅

"/src",
"/python/fastexcel",
"!__pycache__",
"!*.pyc",
"!*.so",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand Down
Loading