|
| 1 | +name: Build Vulkan |
| 2 | + |
| 3 | +on: workflow_dispatch |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: write |
| 7 | + |
| 8 | +jobs: |
| 9 | + build_wheels: |
| 10 | + name: Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }} |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-22.04] |
| 15 | + cibw_archs: ["aarch64"] # Define 'cibw_archs' as part of the job's strategy matrix |
| 16 | + |
| 17 | + steps: |
| 18 | + # Set up QEMU for ARM64 architecture |
| 19 | + - name: Set up QEMU |
| 20 | + if: matrix.cibw_archs == 'aarch64' |
| 21 | + uses: docker/setup-qemu-action@v2 |
| 22 | + with: |
| 23 | + platforms: arm64 |
| 24 | + |
| 25 | + - uses: actions/checkout@v3 |
| 26 | + with: |
| 27 | + submodules: "recursive" |
| 28 | + |
| 29 | + # Used to host cibuildwheel |
| 30 | + - uses: actions/setup-python@v3 |
| 31 | + with: |
| 32 | + python-version: "3.10" |
| 33 | + |
| 34 | + - name: Install dependencies |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + python -m pip install -e .[all] |
| 38 | +
|
| 39 | + - name: Build wheels |
| 40 | + uses: pypa/cibuildwheel@v2.16.5 |
| 41 | + env: |
| 42 | + # disable repair |
| 43 | + CIBW_REPAIR_WHEEL_COMMAND: "" |
| 44 | + CIBW_BUILD: "cp39-manylinux_* cp310-manylinux_* cp311-manylinux_*" |
| 45 | + CIBW_ARCHS: ${{ matrix.cibw_archs }} |
| 46 | + CMAKE_ARGS: "-DLLAMA_VULKAN=on" |
| 47 | + with: |
| 48 | + package-dir: . |
| 49 | + output-dir: wheelhouse |
| 50 | + |
| 51 | + - uses: actions/upload-artifact@v3 |
| 52 | + with: |
| 53 | + path: ./wheelhouse/*.whl |
| 54 | + |
| 55 | + build_sdist: |
| 56 | + name: Build source distribution |
| 57 | + runs-on: ubuntu-latest |
| 58 | + |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v3 |
| 61 | + with: |
| 62 | + submodules: "recursive" |
| 63 | + - uses: actions/setup-python@v3 |
| 64 | + with: |
| 65 | + python-version: "3.10" |
| 66 | + - name: Install dependencies |
| 67 | + run: | |
| 68 | + python -m pip install --upgrade pip build |
| 69 | + python -m pip install -e .[all] |
| 70 | + - name: Build source distribution |
| 71 | + run: | |
| 72 | + python -m build --sdist |
| 73 | + - uses: actions/upload-artifact@v3 |
| 74 | + with: |
| 75 | + path: ./dist/*.tar.gz |
| 76 | + |
| 77 | + release: |
| 78 | + name: Release |
| 79 | + needs: [build_wheels, build_sdist] |
| 80 | + runs-on: ubuntu-latest |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: actions/download-artifact@v3 |
| 84 | + with: |
| 85 | + name: artifact |
| 86 | + path: dist |
| 87 | + - id: tag |
| 88 | + run: | |
| 89 | + echo "::set-output name=release_tag::$(date +"%Y.%m.%d_%H-%M")" |
| 90 | + - uses: softprops/action-gh-release@v1 |
| 91 | + with: |
| 92 | + tag_name: ${{ steps.tag.outputs.release_tag }} |
| 93 | + files: dist/* |
| 94 | + env: |
| 95 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments