Skip to content

Commit

Permalink
add job to upload wheels to continuous pre-release (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
Titus-von-Koeller authored Jul 29, 2024
1 parent 3a6911f commit b64cbe3
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jobs:
name: shared_library_cuda_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.cuda_version }}
path: output/*
retention-days: 7

build-wheels:
needs:
- build-shared-libs
Expand All @@ -121,7 +122,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Download build artifact
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
Expand Down Expand Up @@ -152,6 +153,52 @@ jobs:
path: dist/bitsandbytes-*.whl
retention-days: 7

upload-pre-release-wheels:
name: Create release and upload artifacts
runs-on: ubuntu-latest
needs:
- build-wheels
steps:
- name: Download artifacts to tmp directory
uses: actions/download-artifact@v4
with:
path: tmp/
pattern: "bdist_wheel_*"
merge-multiple: true
- name: Inspect tmp directory after downloading artifacts
run: ls -alFR tmp/
- name: Move and rename wheel files
run: |
mkdir -p wheels/
find tmp/ -type f -name '*.whl' -print0 | while IFS= read -r -d '' wheel; do
wheel_filename=$(basename "$wheel")
if [[ $wheel_filename == *linux*x86_64* ]]; then
mv "$wheel" wheels/bnb-linux-x86_64.whl
elif [[ $wheel_filename == *linux*aarch64* ]]; then
mv "$wheel" wheels/bnb-linux-aarch64.whl
elif [[ $wheel_filename == *macosx*x86_64* ]]; then
mv "$wheel" wheels/bnb-macos-x86_64.whl
elif [[ $wheel_filename == *macosx*arm64* ]]; then
mv "$wheel" wheels/bnb-macos-arm64.whl
elif [[ $wheel_filename == *win*amd64* ]]; then
mv "$wheel" wheels/bnb-windows-x86_64.whl
else
echo "Unknown wheel format: $wheel_filename"
exit 1
fi
done
- name: Inspect wheels directory after renaming files
run: ls -alFR wheels/
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTINUOUS_RELEASE_TYPE: prerelease
GITHUB_CONTINUOUS_RELEASE_TAG: continuous-release_main
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage --appimage-extract-and-run wheels/*.whl
audit-wheels:
needs: build-wheels
runs-on: ubuntu-latest
Expand Down

0 comments on commit b64cbe3

Please sign in to comment.