From b64cbe323171ee02136995b543845a23cbf59524 Mon Sep 17 00:00:00 2001 From: Titus <9048635+Titus-von-Koeller@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:31:26 +0200 Subject: [PATCH] add job to upload wheels to continuous pre-release (#1282) --- .github/workflows/python-package.yml | 49 +++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 698c21481..16143782d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 @@ -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 @@ -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