Skip to content

Commit 1371f2f

Browse files
committed
Update GitHub workflows
1 parent d6e5769 commit 1371f2f

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/pypi.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This workflow builds and publishes Python distributions to PyPI.
22
# It uses a self-hosted runner and a PyTorch container image
33
# to ensure the correct CUDA environment is available for the build.
4+
# It relies on Trusted Publishing for secure authentication with PyPI.
45

56
name: Build and Publish Python 🐍 distributions
67

@@ -35,7 +36,7 @@ jobs:
3536
- name: Install build dependencies
3637
run: |
3738
apt-get update
38-
apt-get install -y --no-install-recommends build-essential curl libssl-dev pkg-config
39+
apt-get install -y --no-install-recommends build-essential curl libssl-dev pkg-config zip
3940
shell: bash
4041

4142
- name: Install Rust
@@ -60,14 +61,24 @@ jobs:
6061
echo "CUDA_LIB_DIR=$LIB_DIR" >> $GITHUB_ENV
6162
shell: bash
6263

63-
- name: Build wheel
64+
- name: Build wheel with auditwheel exclusions
6465
env:
6566
LD_LIBRARY_PATH: ${{ env.CUDA_LIB_DIR }}:${LD_LIBRARY_PATH}
6667
CUDA_COMPUTE_CAP: ${{ matrix.variant.compute-caps }}
6768
AUDITWHEEL_EXCLUDE: "libcuda.so,libnvJitLink.so,libcudart.so,libcublas.so,libcufft.so,libcurand.so,libcusolver.so,libcusparse.so,libcudnn.so"
6869
run: maturin build --release --out dist
6970
shell: bash
7071

72+
- name: Verify wheel contents and size
73+
run: |
74+
echo "--- Verifying wheel contents ---"
75+
WHEEL_FILE=$(ls dist/*.whl)
76+
unzip -l $WHEEL_FILE | grep '\.so'
77+
echo "--- Verifying wheel size ---"
78+
ls -lh dist
79+
# Optionally, fail the build if the wheel is still too large
80+
# find dist -size +95M -exec echo "::error::Wheel size exceeds 95MB" \; -exec exit 1 \;
81+
7182
- name: Upload wheel artifact
7283
uses: actions/upload-artifact@v4
7384
with:
@@ -89,9 +100,5 @@ jobs:
89100
path: dist
90101
merge-multiple: true
91102

92-
- name: Publish to PyPI
103+
- name: Publish to PyPI using Trusted Publishing
93104
uses: pypa/gh-action-pypi-publish@v1.12.4
94-
with:
95-
user: __token__
96-
password: ${{ secrets.PYPI_API_TOKEN }}
97-
skip-existing: true

0 commit comments

Comments
 (0)