Skip to content

Commit fd63bec

Browse files
Update python-package.yml
1 parent 98eed13 commit fd63bec

1 file changed

Lines changed: 44 additions & 19 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,42 +171,67 @@ jobs:
171171
path: tmp/
172172
pattern: "bdist_wheel_*"
173173
merge-multiple: true
174+
174175
- name: Inspect tmp directory after downloading artifacts
175176
run: ls -alFR tmp/
177+
176178
- name: Move and rename wheel files with pattern replacement
177179
run: |
178180
mkdir -p wheels/
179-
180-
# 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
181-
# 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
182-
# wheel directly from the GH pre-release which gets updated continuously, e.g.
183-
# `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`
184181
STABLE_PLACEHOLDER_VERSION="1.33.7.preview"
185-
186-
# exclude macos wheels for now
187182
find tmp/ -type f -name '*.whl' ! -name '*macos*' -print0 | while IFS= read -r -d '' wheel; do
188183
wheel_filename=$(basename "$wheel")
189-
190-
# Strip off the original version
191184
rest=${wheel_filename#bitsandbytes-*-}
192185
new_name="bitsandbytes-${STABLE_PLACEHOLDER_VERSION}-${rest}"
193-
194186
echo "Renaming $wheel_filename → $new_name"
195187
mv "$wheel" "wheels/${new_name}"
196188
done
197-
189+
198190
- name: Inspect wheels directory after renaming files
199191
run: ls -alFR wheels/
200-
- name: Create release and upload artifacts
201-
uses: softprops/action-gh-release@v2.2.1
192+
193+
- name: Delete old pre-release (if exists)
194+
run: |
195+
gh release delete continuous-release_main --cleanup-tag -y || true
196+
env:
197+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198+
199+
- name: Generate pip install commands for release body
200+
run: |
201+
cat <<'EOF' > body.md
202+
## Latest `main` Wheel Pre-release
203+
204+
This pre-release contains the latest development wheels for all supported platforms, rebuilt automatically on every commit to the `main` branch.
205+
206+
**How to install:**
207+
Pick the correct command for your platform and run it in your terminal:
208+
209+
EOF
210+
211+
for whl in wheels/*.whl; do
212+
fname=$(basename "$whl")
213+
url="https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/$fname"
214+
echo "\`\`\`sh" >> body.md
215+
echo "pip install $url" >> body.md
216+
echo "\`\`\`" >> body.md
217+
echo "" >> body.md
218+
done
219+
220+
cat <<'EOF' >> body.md
221+
> **Note:**
222+
> 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.
223+
EOF
224+
225+
- name: Create new pre-release and upload artifacts
226+
uses: ncipollo/release-action@v1
202227
with:
203-
files: wheels/*.whl
204-
prerelease: true
228+
artifacts: wheels/*.whl
229+
tag: continuous-release_main
205230
name: Latest `main` wheel
206-
tag_name: continuous-release_main
207-
make_latest: false
208-
draft: false
209-
target_commitish: ${{ github.sha }}
231+
bodyFile: body.md
232+
prerelease: true
233+
commit: ${{ github.sha }}
234+
210235

211236
audit-wheels:
212237
needs: build-wheels

0 commit comments

Comments
 (0)