build(whl): add fix python again #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Release for Ampere | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - ampere-build-3.2.1 | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build_wheels_arm64: | |
| name: Build arm64 wheels | |
| runs-on: [self-hosted] | |
| container: | |
| image: ubuntu:22.04 | |
| options: --privileged -v /var/run/docker.sock:/var/run/docker.sock | |
| steps: | |
| - name: Install prerequisites | |
| run: | | |
| apt-get update | |
| apt-get install -y git python3 python3-pip docker.io | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.ACCESS_TOKEN }} | |
| submodules: recursive | |
| - name: Install cibuildwheel | |
| run: python3 -m pip install cibuildwheel==2.22.0 | |
| - name: Build wheels | |
| run: python3 -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_SKIP: "*musllinux* pp*" | |
| CIBW_REPAIR_WHEEL_COMMAND: "" | |
| CIBW_ARCHS: "aarch64" | |
| CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux_2_34_aarch64" | |
| CIBW_BEFORE_ALL: "dnf install -y gcc-toolset-13" | |
| CIBW_ENVIRONMENT: > | |
| CC=/opt/rh/gcc-toolset-13/root/usr/bin/gcc | |
| CXX=/opt/rh/gcc-toolset-13/root/usr/bin/g++ | |
| CMAKE_ARGS="-DGGML_NATIVE=OFF | |
| -DCMAKE_CXX_FLAGS=-march=armv8.2-a+dotprod+fp16 | |
| -DCMAKE_C_FLAGS=-march=armv8.2-a+dotprod+fp16" | |
| CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" | |
| - name: Inspect wheel contents | |
| run: | | |
| for whl in wheelhouse/*.whl; do | |
| echo "=== $(basename $whl) ===" | |
| python3 -m zipfile -l "$whl" | |
| done | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels_arm64 | |
| path: ./wheelhouse/*.whl | |
| release: | |
| name: Release | |
| needs: [build_wheels_arm64] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: [self-hosted] | |
| container: | |
| image: ubuntu:22.04 | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels_arm64 | |
| path: dist | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| name: Publish to PyPI | |
| needs: [build_wheels_arm64] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: [self-hosted] | |
| container: | |
| image: ubuntu:22.04 | |
| steps: | |
| - name: Install prerequisites | |
| run: | | |
| apt-get update | |
| apt-get install -y python3 python3-pip | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels_arm64 | |
| path: dist/ | |
| - name: Publish to PyPI | |
| run: | | |
| python3 -m pip install twine | |
| python3 -m twine upload --non-interactive dist/*.whl | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |