4444 - name : Checkout source code
4545 uses : actions/checkout@v6
4646 with :
47- ref : ${{ github.event.pull_request.head.sha }}
47+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
4848 - id : check_build_trigger
4949 name : Check build trigger
5050 run : bash build_tools/github/check_build_trigger.sh
@@ -56,13 +56,11 @@ jobs:
5656 needs : check_build_trigger
5757 if : needs.check_build_trigger.outputs.build
5858 strategy :
59- # Ensure that a wheel builder finishes even if another fails
60- fail-fast : false
59+ fail-fast : false # If false, all jobs continue even if one fails
6160 matrix :
6261 os : [macos-latest, ubuntu-latest, windows-latest]
6362 python-version : ["3.14"] # Check with PyO3's maximum supported version
64- env :
65- CIBW_BUILD : " " # blank, let cibuildwheel build all supported platforms
63+ # cibuildwheel will manage multiple Python versions internally
6664
6765 steps :
6866 - name : Checkout source code
@@ -92,17 +90,19 @@ jobs:
9290 package-dir : nlpo3-python
9391 output-dir : wheelhouse
9492 env :
95- CIBW_BUILD_VERBOSITY : 1
9693 # See CIBW_BUILD, CIBW_SKIP, CIBW_ARCHS and other build selectors at:
9794 # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
98- CIBW_SKIP : " *-musllinux_i686"
95+ CIBW_ENABLE : " graalpy pypy" # Enable GraalPy and PyPy builds
96+ CIBW_BUILD : " cp* gp* pp*" # Build for CPython, GraalPy and PyPy
97+ CIBW_BUILD_VERBOSITY : 1
98+ CIBW_SKIP : " *-musllinux_i686 gp*-win_*"
9999 CIBW_ARCHS_MACOS : " x86_64 arm64"
100100 CIBW_ENVIRONMENT_MACOS : |
101101 MACOSX_DEPLOYMENT_TARGET=10.12
102102 PATH="$HOME/.cargo/bin:$PATH"
103103 CC=/usr/bin/clang
104104 CXX=/usr/bin/clang++
105- CIBW_ARCHS_LINUX : " auto "
105+ CIBW_ARCHS_LINUX : " x86_64 i686 "
106106 CIBW_ENVIRONMENT_LINUX : PATH="$HOME/.cargo/bin:$PATH"
107107 CIBW_BEFORE_BUILD_LINUX : |
108108 pip install --upgrade setuptools-rust
@@ -112,13 +112,20 @@ jobs:
112112 # and the container does not have Rust.
113113 CIBW_ARCHS_WINDOWS : " AMD64 x86"
114114
115+ - name : List wheel files
116+ run : |
117+ echo "Files to upload (binary wheels):"
118+ find ./wheelhouse -maxdepth 1 -type f -name '*.whl' -print | sort || true
119+ echo "Count: $(find ./wheelhouse -maxdepth 1 -type f -name '*.whl' -print | wc -l || true)"
120+ shell : bash
115121 - name : Store artifacts
116122 uses : actions/upload-artifact@v6
117123 with :
118124 path : ./wheelhouse/*.whl
119- name : wheelhouse-${{ matrix.os }}-${{ matrix.python-version }}
125+ name : ${{ github.job }}- wheelhouse-${{ matrix.os }}-${{ github.run_id }}
120126 if-no-files-found : warn
121127 overwrite : true
128+ retention-days : 1
122129
123130 build_sdist :
124131 name : Build source distribution
@@ -131,16 +138,25 @@ jobs:
131138 - name : Setup Python
132139 uses : actions/setup-python@v6
133140 with :
134- python-version : " 3.14" # Check with PyO3's maximum supported version
141+ python-version : " 3.14" # Ideally matches with the python-version in build_wheels
135142 cache : " pip"
136143 - name : Build source distribution
137144 run : |
138145 cd nlpo3-python
139146 bash ../build_tools/github/build_source.sh
147+ - name : List sdist files
148+ run : |
149+ echo "Files to upload (sdist):"
150+ find nlpo3-python/dist -maxdepth 1 -type f -name '*.tar.gz' -print | sort || true
151+ echo "Count: $(find nlpo3-python/dist -maxdepth 1 -type f -name '*.tar.gz' -print | wc -l || true)"
152+ shell : bash
140153 - name : Store artifacts
141154 uses : actions/upload-artifact@v6
142155 with :
143156 path : nlpo3-python/dist/*.tar.gz
157+ name : sdist
158+ overwrite : true
159+ retention-days : 1
144160
145161 publish_pypi :
146162 name : Publish to PyPI
@@ -151,11 +167,11 @@ jobs:
151167 # Alternatively, upload to PyPI on every tag starting with 'v':
152168 # if: github.event_name == 'push' && startsWith(github.event.ref, 'v')
153169 steps :
154- - name : Retrieve artifacts
170+ - name : Retrieve all artifacts
155171 uses : actions/download-artifact@v6
156172 with :
157- name : artifact
158173 path : dist
174+ merge-multiple : true
159175 - name : Publish package
160176 uses : pypa/gh-action-pypi-publish@v1.13.0
161177 with :
0 commit comments