@@ -30,14 +30,16 @@ jobs:
3030 build-shared-libs :
3131 strategy :
3232 matrix :
33- os : [ubuntu-22.04, macos-latest, windows-latest]
34- arch : [x86_64, aarch64]
35- exclude :
36- - os : windows-latest # This probably requires arm64 Windows agents
33+ include :
34+ - os : ubuntu-22.04
35+ arch : x86_64
36+ - os : ubuntu-22.04-arm
3737 arch : aarch64
38- - os : ubuntu-latest # Temporary. Takes too long, not ready yet.
39- arch : aarch64
40- runs-on : ${{ matrix.os }} # One day, we could run them on native agents. Azure supports this now but it's planned only for Q3 2023 for hosted agents
38+ - os : windows-latest
39+ arch : x86_64
40+ - os : macos-latest
41+ arch : arm64
42+ runs-on : ${{ matrix.os }}
4143 steps :
4244 - uses : actions/checkout@v4
4345 - name : Setup MSVC
@@ -61,24 +63,21 @@ jobs:
6163 strategy :
6264 fail-fast : false
6365 matrix :
64- os : [ubuntu-latest, windows-latest]
65- arch : [x86_64, aarch64]
66- cuda_version :
67- ["11.7.1", "11.8.0", "12.0.1", "12.1.1", "12.2.2", "12.3.2", "12.4.1", "12.5.1", "12.6.3", "12.8.0"]
68- exclude :
69- - os : windows-latest # This probably requires arm64 Windows agents
66+ os : [ubuntu-22.04, ubuntu-22.04-arm, windows-latest]
67+ include :
68+ - os : ubuntu-22.04
69+ arch : x86_64
70+ - os : ubuntu-22.04-arm
7071 arch : aarch64
71- - os : ubuntu-latest # Temporary. Takes too long, not ready yet.
72- arch : aarch64
73- runs-on : ${{ matrix.os }} # One day, we could run them on native agents. Azure supports this now but it's planned only for Q3 2023 for hosted agents
72+ - os : windows-latest
73+ arch : x86_64
74+ cuda_version :
75+ ["11.8.0", "12.0.1", "12.1.1", "12.2.2", "12.3.2", "12.4.1", "12.5.1", "12.6.3", "12.8.1"]
76+ runs-on : ${{ matrix.os }}
7477 steps :
7578 - uses : actions/checkout@v4
76- # Linux: We use Docker to build cross platform Cuda (aarch64 is built in emulation)
77- - name : Set up Docker multiarch
78- if : startsWith(matrix.os, 'ubuntu')
79- uses : docker/setup-qemu-action@v3
8079 # Windows: We install Cuda on the agent (slow)
81- -
uses :
Jimver/[email protected] .21 80+ -
uses :
Jimver/[email protected] .22 8281 if : startsWith(matrix.os, 'windows')
8382 id : cuda-toolkit
8483 with :
@@ -109,17 +108,20 @@ jobs:
109108 - build-shared-libs-cuda
110109 strategy :
111110 matrix :
112- os : [ubuntu-latest, macos-latest, windows-latest]
111+ os : [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-latest]
112+ include :
113+ - os : ubuntu-22.04
114+ arch : x86_64
115+ - os : ubuntu-22.04-arm
116+ arch : aarch64
117+ - os : windows-latest
118+ arch : x86_64
119+ - os : macos-latest
120+ arch : arm64
113121 # The specific Python version is irrelevant in this context as we are only packaging non-C extension
114- # code. This ensures compatibility across Python versions, including Python 3.8 , as compatibility is
122+ # code. This ensures compatibility across Python versions, including Python 3.9 , as compatibility is
115123 # dictated by the packaged code itself, not the Python version used for packaging.
116124 python-version : ["3.10"]
117- arch : [x86_64, aarch64]
118- exclude :
119- - os : windows-latest # This probably requires arm64 Windows agents
120- arch : aarch64
121- - os : ubuntu-latest # Temporary. Takes too long, not ready yet.
122- arch : aarch64
123125 runs-on : ${{ matrix.os }}
124126 steps :
125127 - uses : actions/checkout@v4
@@ -169,43 +171,137 @@ jobs:
169171 path : tmp/
170172 pattern : " bdist_wheel_*"
171173 merge-multiple : true
174+
172175 - name : Inspect tmp directory after downloading artifacts
173- run : ls -alFR tmp/
176+ run : |
177+ ls -alFR tmp/
178+ WHEEL_COUNT=$(find tmp/ -type f -name "*.whl" | wc -l)
179+ echo "Found $WHEEL_COUNT wheel files"
180+ if [ "$WHEEL_COUNT" -eq 0 ]; then
181+ echo "::error::No wheel files found in tmp directory! Cannot proceed with release."
182+ exit 1
183+ fi
184+
174185 - name : Move and rename wheel files with pattern replacement
175186 run : |
176187 mkdir -p wheels/
188+
189+ # The whole point of the continuous release is to have a stable download link and the only way to have a PEP 440–compliant wheel name
190+ # is to use a stable placeholder version. Otherwise, pip won't let you install the wheel. The cool thing is that we can now install the
191+ # wheel directly from the GH pre-release which gets updated continuously, e.g.
192+ # `pip install https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-manylinux_2_24_x86_64.whl`
193+ STABLE_PLACEHOLDER_VERSION="1.33.7.preview"
194+
177195 # exclude macos wheels for now
178196 find tmp/ -type f -name '*.whl' ! -name '*macos*' -print0 | while IFS= read -r -d '' wheel; do
179197 wheel_filename=$(basename "$wheel")
180- # Remove the gith hash, e.g. `+1234567`, for a stable download link on the multi-backend pre-release
181- cleaned_filename=$(echo "$wheel_filename" | sed -E 's/\+[0-9a-f]{7}-/-/g')
182- mv "$wheel" "wheels/$cleaned_filename"
198+
199+ # Strip off the original version
200+ rest=${wheel_filename#bitsandbytes-*-}
201+ new_name="bitsandbytes-${STABLE_PLACEHOLDER_VERSION}-${rest}"
202+
203+ echo "Renaming $wheel_filename → $new_name"
204+ mv "$wheel" "wheels/${new_name}"
183205 done
206+
184207 - name : Inspect wheels directory after renaming files
185208 run : ls -alFR wheels/
186- - name : Create release and upload artifacts
187- 209+
210+ - uses : actions/checkout@v4
211+ with :
212+ path : repo
213+ - name : Delete old pre-release (if exists)
214+ run : |
215+ cd repo && gh release delete continuous-release_main --cleanup-tag -y
216+ env :
217+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
218+
219+ - name : Ensure tag exists
220+ run : |
221+ cd repo
222+ git tag -f continuous-release_main
223+ git push -f origin continuous-release_main
224+ env :
225+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
226+
227+ - name : Generate pip install commands for release body
228+ run : |
229+ cat > body.md << 'ENDOFMARKDOWN'
230+ ## Latest `main` pre-release wheel
231+
232+ This pre-release contains the latest development wheels for all supported platforms, rebuilt automatically on every commit to the `main` branch.
233+
234+ **How to install:**
235+ Pick the correct command for your platform and run it in your terminal:
236+
237+ ENDOFMARKDOWN
238+
239+ for whl in wheels/*.whl; do
240+ fname=$(basename "$whl")
241+ url="https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/$fname"
242+
243+ if [[ "$fname" == *"manylinux_2_24_x86_64"* ]]; then
244+ echo "### Linux (x86_64)" >> body.md
245+ elif [[ "$fname" == *"manylinux_2_24_aarch64"* ]]; then
246+ echo "### Linux (ARM/aarch64)" >> body.md
247+ elif [[ "$fname" == *"win_amd64"* ]]; then
248+ echo "### Windows (x86_64)" >> body.md
249+ else
250+ echo "### Other platform" >> body.md
251+ fi
252+
253+ echo "\`\`\`sh" >> body.md
254+ echo "pip install --force-reinstall $url" >> body.md
255+ echo "\`\`\`" >> body.md
256+ echo "" >> body.md
257+ done
258+
259+ cat >> body.md << 'ENDOFMARKDOWN'
260+ > **Note:**
261+ > These wheels are updated automatically with every commit to `main` and become available as soon as the [python-package.yml](.github/workflows/python-package.yml) workflow finishes.
262+
263+ The version number is replaced with 1.33.7-preview in order to keep the link stable, this however does not affect the installed version at all:
264+ ```
265+ > pip install https://.../bitsandbytes-1.33.7-preview-py3-none-manylinux_2_24_x86_64.whl
266+ Collecting bitsandbytes==1.33.7rc0
267+ ...
268+ Successfully installed bitsandbytes-0.46.0.dev0
269+ ```
270+ ENDOFMARKDOWN
271+
272+ # for debugging:
273+ cat body.md
274+
275+ - name : Create new pre-release and upload artifacts
276+ 188277 with :
189278 files : wheels/*.whl
190279 prerelease : true
191280 name : Latest `main` wheel
281+ body_path : body.md
192282 tag_name : continuous-release_main
193283 make_latest : false
194284 draft : false
195- target_commitish : ${{ github.sha }}
196285
197286 audit-wheels :
198287 needs : build-wheels
199- runs-on : ubuntu-latest
288+ strategy :
289+ matrix :
290+ os : [ubuntu-22.04, ubuntu-22.04-arm]
291+ include :
292+ - os : ubuntu-22.04
293+ arch : x86_64
294+ - os : ubuntu-22.04-arm
295+ arch : aarch64
296+ runs-on : ${{ matrix.os }}
200297 env :
201298 PIP_DISABLE_PIP_VERSION_CHECK : 1
202299 steps :
203300 - uses : actions/checkout@v4
204- - name : Download all wheels
301+ - name : Download wheel
205302 uses : actions/download-artifact@v4
206303 with :
207- merge-multiple : true
208- pattern : " bdist_wheel_*"
304+ name : bdist_wheel_${{ matrix.os }}_${{ matrix.arch }}
209305 path : wheels/
210306 - name : Set up Python
211307 uses : actions/setup-python@v5
@@ -241,33 +337,3 @@ jobs:
241337 uses : pypa/gh-action-pypi-publish@release/v1
242338 with :
243339 print-hash : true
244-
245- # test:
246- # needs:
247- # - build-wheels
248- # strategy:
249- # fail-fast: false
250- # matrix:
251- # include:
252- # - os: ubuntu-latest
253- # arch: x86_64
254- # python-version: "3.8"
255- # - os: windows-latest
256- # arch: x86_64
257- # python-version: "3.8"
258- # runs-on: ${{ matrix.os }}
259- # steps:
260- # - uses: actions/checkout@v4
261- # - uses: actions/download-artifact@v4
262- # with:
263- # merge-multiple: true
264- # pattern: "bdist_wheel_${{ matrix.os }}_${{ matrix.arch }}*"
265- # path: wheel/
266- # - uses: actions/setup-python@v5
267- # with:
268- # python-version: ${{ matrix.python-version }}
269- # cache: pip
270- # - shell: bash
271- # run: ls -lar wheel/
272- # - run: pip install wheel/*.whl -r requirements-ci.txt
273- # - run: pytest --log-cli-level=DEBUG --continue-on-collection-errors tests
0 commit comments