From b2eb53b32eac0e1684f6bea89dd5e45efb78d587 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 8 Aug 2025 00:04:13 -0400 Subject: [PATCH 1/7] Update build-and-release.yaml --- .github/workflows/build-and-release.yaml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 7eaf017fbc..427ec4433b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2022, macos-14, macos-15] + os: [ubuntu-22.04] steps: - uses: actions/checkout@v4 @@ -31,16 +31,6 @@ jobs: RUST_LOG=trace python -m uv pip install -e .[all] --verbose shell: bash - - name: Install dependencies (Windows) - if: runner.os == 'Windows' - env: - RUST_LOG: trace - run: | - python -m pip install --upgrade pip - python -m pip install uv - python -m uv pip install -e .[all] --verbose - shell: cmd - - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: @@ -107,17 +97,6 @@ jobs: python -m uv pip install build shell: bash - - name: Install dependencies (Windows) - if: runner.os == 'Windows' - env: - RUST_LOG: trace - run: | - python -m pip install --upgrade pip - python -m pip install uv - python -m uv pip install -e .[all] --verbose - python -m uv pip install build - shell: cmd - - name: Build source distribution run: | python -m build --sdist From f2c403f5b2c75e24b3e6de9c49579a6a69fe2677 Mon Sep 17 00:00:00 2001 From: Michael Hu Date: Tue, 12 Aug 2025 19:47:46 -0500 Subject: [PATCH 2/7] add macos --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 427ec4433b..c435b6cd6b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] + os: [ubuntu-22.04, macos-14, macos-15] steps: - uses: actions/checkout@v4 From d5a35cb92b32073a0021895a35813875ff01b758 Mon Sep 17 00:00:00 2001 From: Michael Hu Date: Tue, 12 Aug 2025 19:55:10 -0500 Subject: [PATCH 3/7] explicit release --- .github/workflows/build-and-release.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index c435b6cd6b..d19175cc39 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -117,8 +117,18 @@ jobs: merge-multiple: true path: dist - - uses: softprops/action-gh-release@v2 + - name: Create Release + uses: softprops/action-gh-release@v2 with: + tag_name: release-${{ github.run_number }}-${{ github.run_attempt }} + name: Release ${{ github.run_number }} + body: | + Automated release created by GitHub Actions. + Run Number: ${{ github.run_number }} + Run Attempt: ${{ github.run_attempt }} + Commit: ${{ github.sha }} files: dist/* + draft: false + prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 67903e0fe6c0006f94840140d354a78d04a30c62 Mon Sep 17 00:00:00 2001 From: Michael Hu Date: Sat, 16 Aug 2025 22:08:02 -0500 Subject: [PATCH 4/7] build only for apple sillicon --- .github/workflows/build-and-release.yaml | 81 ++++++++++++------------ 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index d19175cc39..5a28b546d7 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -6,48 +6,50 @@ permissions: contents: write jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-22.04, macos-14, macos-15] - - steps: - - uses: actions/checkout@v4 - with: - submodules: "recursive" - - # Used to host cibuildwheel - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - - name: Install dependencies (Linux/MacOS) - if: runner.os != 'Windows' - run: | - python -m pip install --upgrade pip - python -m pip install uv - RUST_LOG=trace python -m uv pip install -e .[all] --verbose - shell: bash - - - name: Build wheels - uses: pypa/cibuildwheel@v2.22.0 - env: - # disable repair - CIBW_REPAIR_WHEEL_COMMAND: "" - with: - package-dir: . - output-dir: wheelhouse - - - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }} - path: ./wheelhouse/*.whl + # build_wheels: + # name: Build wheels on ${{ matrix.os }} + # runs-on: ${{ matrix.os }} + # timeout-minutes: 360 + # strategy: + # matrix: + # os: [ubuntu-22.04, macos-14, macos-15] + + # steps: + # - uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # # Used to host cibuildwheel + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.9" + + # - name: Install dependencies (Linux/MacOS) + # if: runner.os != 'Windows' + # run: | + # python -m pip install --upgrade pip + # python -m pip install uv + # RUST_LOG=trace python -m uv pip install -e .[all] --verbose + # shell: bash + + # - name: Build wheels + # uses: pypa/cibuildwheel@v2.22.0 + # env: + # # disable repair + # CIBW_REPAIR_WHEEL_COMMAND: "" + # with: + # package-dir: . + # output-dir: wheelhouse + + # - uses: actions/upload-artifact@v4 + # with: + # name: wheels-${{ matrix.os }} + # path: ./wheelhouse/*.whl build_wheels_arm64: name: Build arm64 wheels runs-on: ubuntu-latest + timeout-minutes: 360 steps: - uses: actions/checkout@v4 with: @@ -78,6 +80,7 @@ jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest + timeout-minutes: 360 steps: - uses: actions/checkout@v4 @@ -108,7 +111,7 @@ jobs: release: name: Release - needs: [build_wheels, build_wheels_arm64, build_sdist] + needs: [build_wheels_arm64, build_sdist] runs-on: ubuntu-latest steps: From 093f8bbb628abb21fe29d4e0d9f8bf5d3cc54a01 Mon Sep 17 00:00:00 2001 From: Michael Hu Date: Sun, 17 Aug 2025 00:36:56 -0500 Subject: [PATCH 5/7] fix release --- .github/workflows/generate-index-from-release.yaml | 4 ++-- scripts/releases-to-pep-503.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-index-from-release.yaml b/.github/workflows/generate-index-from-release.yaml index 255ee67d6f..e3b4c12499 100644 --- a/.github/workflows/generate-index-from-release.yaml +++ b/.github/workflows/generate-index-from-release.yaml @@ -44,8 +44,8 @@ jobs: ./scripts/releases-to-pep-503.sh index/whl/cu122 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu122$' ./scripts/releases-to-pep-503.sh index/whl/cu123 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu123$' ./scripts/releases-to-pep-503.sh index/whl/cu124 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu124$' - # ./scripts/releases-to-pep-503.sh index/whl/cu125 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu124$' - # ./scripts/releases-to-pep-503.sh index/whl/cu126 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu124$' + ./scripts/releases-to-pep-503.sh index/whl/cu125 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu125$' + ./scripts/releases-to-pep-503.sh index/whl/cu126 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu126$' ./scripts/releases-to-pep-503.sh index/whl/metal '^[v]?[0-9]+\.[0-9]+\.[0-9]+-metal$' - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/scripts/releases-to-pep-503.sh b/scripts/releases-to-pep-503.sh index 71910efcbf..11dd5ff477 100755 --- a/scripts/releases-to-pep-503.sh +++ b/scripts/releases-to-pep-503.sh @@ -68,7 +68,7 @@ headers+=('--header' 'content-type: application/json') for release in $releases; do log_info "Processing release: $release" response=$(curl -s "${headers[@]}" \ - "https://api.github.com/repos/abetlen/llama-cpp-python/releases/tags/$release") + "https://api.github.com/repos/PXMYH/llama-cpp-python/releases/tags/$release") if [ -z "$response" ]; then log_error "Empty response from GitHub API for release $release" From b6cfaa0a4082e0b291772222ad8911f67e38bc0a Mon Sep 17 00:00:00 2001 From: Michael Hu Date: Sun, 17 Aug 2025 09:45:16 -0500 Subject: [PATCH 6/7] add ubuntu platform back but only build for linux --- .github/workflows/build-and-release.yaml | 78 ++++++++++++------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 5a28b546d7..51ad5ba97a 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -6,45 +6,45 @@ permissions: contents: write jobs: - # build_wheels: - # name: Build wheels on ${{ matrix.os }} - # runs-on: ${{ matrix.os }} - # timeout-minutes: 360 - # strategy: - # matrix: - # os: [ubuntu-22.04, macos-14, macos-15] - - # steps: - # - uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # # Used to host cibuildwheel - # - uses: actions/setup-python@v5 - # with: - # python-version: "3.9" - - # - name: Install dependencies (Linux/MacOS) - # if: runner.os != 'Windows' - # run: | - # python -m pip install --upgrade pip - # python -m pip install uv - # RUST_LOG=trace python -m uv pip install -e .[all] --verbose - # shell: bash - - # - name: Build wheels - # uses: pypa/cibuildwheel@v2.22.0 - # env: - # # disable repair - # CIBW_REPAIR_WHEEL_COMMAND: "" - # with: - # package-dir: . - # output-dir: wheelhouse - - # - uses: actions/upload-artifact@v4 - # with: - # name: wheels-${{ matrix.os }} - # path: ./wheelhouse/*.whl + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + timeout-minutes: 360 + strategy: + matrix: + os: [ubuntu-22.04] + + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + + # Used to host cibuildwheel + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Install dependencies (Linux/MacOS) + if: runner.os != 'Windows' + run: | + python -m pip install --upgrade pip + python -m pip install uv + RUST_LOG=trace python -m uv pip install -e .[all] --verbose + shell: bash + + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + env: + # disable repair + CIBW_REPAIR_WHEEL_COMMAND: "" + with: + package-dir: . + output-dir: wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl build_wheels_arm64: name: Build arm64 wheels From b530b3e48b7331c85b2c59942de6444e5d083ec9 Mon Sep 17 00:00:00 2001 From: Michael Hu Date: Sun, 17 Aug 2025 12:58:35 -0500 Subject: [PATCH 7/7] skip i686 build --- .github/workflows/build-and-release.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 51ad5ba97a..94ef75cfec 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -35,6 +35,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: + CIBW_ARCHS: "x86_64" # disable repair CIBW_REPAIR_WHEEL_COMMAND: "" with: @@ -67,7 +68,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND: "" CIBW_ARCHS: "aarch64" CIBW_ENVIRONMENT: CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DCMAKE_CROSSCOMPILING=ON" - CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" with: output-dir: wheelhouse @@ -111,7 +112,7 @@ jobs: release: name: Release - needs: [build_wheels_arm64, build_sdist] + needs: [build_wheels, build_wheels_arm64, build_sdist] runs-on: ubuntu-latest steps: