Skip to content

Commit

Permalink
feat(ci): publish sdist to PyPI as well (#284)
Browse files Browse the repository at this point in the history
* feat(ci): publish sdist to PyPI as well

closes #283

Signed-off-by: Luka Peschke <[email protected]>

* fix: add missing checkout step

Signed-off-by: Luka Peschke <[email protected]>

---------

Signed-off-by: Luka Peschke <[email protected]>
  • Loading branch information
lukapeschke authored Sep 17, 2024
1 parent 21ea958 commit f25be6d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
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",
"/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

0 comments on commit f25be6d

Please sign in to comment.