| 1 | # We create a composite action to be re-used both for testing and for releasing |
| 2 | name: build-linux-wheel |
| 3 | description: "Build a manylinux wheel for lance" |
| 4 | inputs: |
| 5 | python-minor-version: |
| 6 | description: "8, 9, 10, 11, 12" |
| 7 | required: true |
| 8 | args: |
| 9 | description: "--release" |
| 10 | required: false |
| 11 | default: "" |
| 12 | arm-build: |
| 13 | description: "Build for arm64 instead of x86_64" |
| 14 | # Note: this does *not* mean the host is arm64, since we might be cross-compiling. |
| 15 | required: false |
| 16 | default: "false" |
| 17 | manylinux: |
| 18 | description: "The manylinux version to build for" |
| 19 | required: false |
| 20 | default: "2_17" |
| 21 | runs: |
| 22 | using: "composite" |
| 23 | steps: |
| 24 | - name: CONFIRM ARM BUILD |
| 25 | shell: bash |
| 26 | run: | |
| 27 | echo "ARM BUILD: ${{ inputs.arm-build }}" |
| 28 | - name: Build x86_64 Manylinux wheel |
| 29 | if: ${{ inputs.arm-build == 'false' }} |
| 30 | uses: PyO3/maturin-action@v1 |
| 31 | with: |
| 32 | command: build |
| 33 | working-directory: python |
| 34 | target: x86_64-unknown-linux-gnu |
| 35 | manylinux: ${{ inputs.manylinux }} |
| 36 | args: ${{ inputs.args }} |
| 37 | before-script-linux: | |
| 38 | set -e |
| 39 | yum install -y openssl-devel \ |
| 40 | && curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-$(uname -m).zip > /tmp/protoc.zip \ |
| 41 | && unzip /tmp/protoc.zip -d /usr/local \ |
| 42 | && rm /tmp/protoc.zip |
| 43 | - name: Build Arm Manylinux Wheel |
| 44 | if: ${{ inputs.arm-build == 'true' }} |
| 45 | uses: PyO3/maturin-action@v1 |
| 46 | with: |
| 47 | command: build |
| 48 | working-directory: python |
| 49 | docker-options: "-e PIP_EXTRA_INDEX_URL=https://pypi.fury.io/lancedb/" |
| 50 | target: aarch64-unknown-linux-gnu |
| 51 | manylinux: ${{ inputs.manylinux }} |
| 52 | args: ${{ inputs.args }} |
| 53 | before-script-linux: | |
| 54 | set -e |
| 55 | apt install -y unzip |
| 56 | if [ $(uname -m) = "x86_64" ]; then |
| 57 | PROTOC_ARCH="x86_64" |
| 58 | else |
| 59 | PROTOC_ARCH="aarch_64" |
| 60 | fi |
| 61 | curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-$PROTOC_ARCH.zip > /tmp/protoc.zip \ |
| 62 | && unzip /tmp/protoc.zip -d /usr/local \ |
| 63 | && rm /tmp/protoc.zip |