Skip to content

Commit cabbe20

Browse files
Merge branch 'main' into testing-improvements
2 parents 4deb566 + 3176277 commit cabbe20

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

.github/workflows/python-package.yml

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,17 @@ jobs:
171171
path: tmp/
172172
pattern: "bdist_wheel_*"
173173
merge-multiple: true
174+
174175
- name: Inspect tmp directory after downloading artifacts
175-
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+
176185
- name: Move and rename wheel files with pattern replacement
177186
run: |
178187
mkdir -p wheels/
@@ -197,16 +206,74 @@ jobs:
197206
198207
- name: Inspect wheels directory after renaming files
199208
run: ls -alFR wheels/
200-
- name: Create release and upload artifacts
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 $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+
ENDOFMARKDOWN
263+
264+
# for debugging:
265+
cat body.md
266+
267+
- name: Create new pre-release and upload artifacts
201268
uses: softprops/[email protected]
202269
with:
203270
files: wheels/*.whl
204271
prerelease: true
205272
name: Latest `main` wheel
273+
body_path: body.md
206274
tag_name: continuous-release_main
207275
make_latest: false
208276
draft: false
209-
target_commitish: ${{ github.sha }}
210277

211278
audit-wheels:
212279
needs: build-wheels

0 commit comments

Comments
 (0)