|
44 | 44 | name: wheels-${{ matrix.runs-on }}-${{ matrix.python-version }} |
45 | 45 | path: dist |
46 | 46 |
|
| 47 | + build-python-sdk-musl: |
| 48 | + runs-on: ubuntu-24.04 |
| 49 | + strategy: |
| 50 | + fail-fast: true |
| 51 | + matrix: |
| 52 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 53 | + target: [x86_64-unknown-linux-musl, aarch64-unknown-linux-musl] |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + uses: actions/checkout@v4 |
| 57 | + with: |
| 58 | + submodules: true |
| 59 | + - uses: actions/setup-python@v5 |
| 60 | + with: |
| 61 | + python-version: ${{ matrix.python-version }} |
| 62 | + - name: Install Rust toolchain |
| 63 | + uses: dtolnay/rust-toolchain@stable |
| 64 | + with: |
| 65 | + toolchain: stable |
| 66 | + targets: ${{ matrix.target }} |
| 67 | + - name: Setup QEMU |
| 68 | + if: matrix.target == 'aarch64-unknown-linux-musl' |
| 69 | + uses: docker/setup-qemu-action@v3 |
| 70 | + with: |
| 71 | + platforms: arm64 |
| 72 | + - name: Build wheels (musl) |
| 73 | + uses: PyO3/maturin-action@v1 |
| 74 | + with: |
| 75 | + target: ${{ matrix.target }} |
| 76 | + manylinux: musllinux_1_2 |
| 77 | + args: -i python${{ matrix.python-version }} --release --out dist -m python/Cargo.toml |
| 78 | + - name: Install built wheel |
| 79 | + run: | |
| 80 | + docker run --rm \ |
| 81 | + --platform ${{ matrix.target == 'aarch64-unknown-linux-musl' && 'linux/arm64' || 'linux/amd64' }} \ |
| 82 | + -v $(pwd)/dist:/dist \ |
| 83 | + python:${{ matrix.python-version }}-alpine \ |
| 84 | + sh -c "pip install --upgrade pip && pip install longbridge --no-index --find-links /dist --force-reinstall && python -c 'import longbridge'" |
| 85 | + - name: Upload wheels |
| 86 | + uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: wheels-musl-${{ matrix.target }}-${{ matrix.python-version }} |
| 89 | + path: dist |
| 90 | + |
47 | 91 | build-nodejs-sdk: |
48 | 92 | strategy: |
49 | 93 | fail-fast: true |
@@ -506,6 +550,7 @@ jobs: |
506 | 550 | build: |
507 | 551 | needs: |
508 | 552 | - build-python-sdk |
| 553 | + - build-python-sdk-musl |
509 | 554 | - build-nodejs-sdk |
510 | 555 | - build-java-jni |
511 | 556 | - build-cpp-sdk-debug |
|
0 commit comments