Skip to content

Commit 5eb35ec

Browse files
continuous build: refine + make sure release is always fresh
1 parent 98eed13 commit 5eb35ec

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

.github/workflows/python-package.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ 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/
@@ -197,12 +199,49 @@ jobs:
197199
198200
- name: Inspect wheels directory after renaming files
199201
run: ls -alFR wheels/
200-
- name: Create release and upload artifacts
202+
203+
- name: Delete old pre-release (if exists)
204+
run: |
205+
gh release delete continuous-release_main --cleanup-tag -y || true
206+
env:
207+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208+
209+
- name: Generate pip install commands for release body
210+
run: |
211+
cat > body.md << 'ENDOFMARKDOWN'
212+
## Latest `main` Wheel Pre-release
213+
214+
This pre-release contains the latest development wheels for all supported platforms, rebuilt automatically on every commit to the `main` branch.
215+
216+
**How to install:**
217+
Pick the correct command for your platform and run it in your terminal:
218+
219+
ENDOFMARKDOWN
220+
221+
for whl in wheels/*.whl; do
222+
fname=$(basename "$whl")
223+
url="https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/$fname"
224+
echo "\`\`\`sh" >> body.md
225+
echo "pip install $url" >> body.md
226+
echo "\`\`\`" >> body.md
227+
echo "" >> body.md
228+
done
229+
230+
cat >> body.md << 'ENDOFMARKDOWN'
231+
> **Note:**
232+
> 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.
233+
ENDOFMARKDOWN
234+
235+
# for debugging:
236+
cat body.md
237+
238+
- name: Create new pre-release and upload artifacts
201239
uses: softprops/action-gh-release@v2.2.1
202240
with:
203241
files: wheels/*.whl
204242
prerelease: true
205243
name: Latest `main` wheel
244+
body_path: body.md
206245
tag_name: continuous-release_main
207246
make_latest: false
208247
draft: false

0 commit comments

Comments
 (0)