|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | | - - main |
| 6 | + - v3-longport |
7 | 7 | pull_request: {} |
8 | 8 |
|
9 | 9 | jobs: |
|
85 | 85 | pip install longport --no-index --find-links dist --force-reinstall |
86 | 86 | python -c "import longport" |
87 | 87 |
|
| 88 | + check-python-sdk-musl: |
| 89 | + needs: |
| 90 | + - check-format |
| 91 | + strategy: |
| 92 | + fail-fast: true |
| 93 | + matrix: |
| 94 | + target: [x86_64-unknown-linux-musl, aarch64-unknown-linux-musl] |
| 95 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 96 | + runs-on: ubuntu-22.04 |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@v4 |
| 99 | + with: |
| 100 | + submodules: true |
| 101 | + |
| 102 | + - name: Install Python |
| 103 | + uses: actions/setup-python@v5 |
| 104 | + with: |
| 105 | + python-version: ${{ matrix.python-version }} |
| 106 | + |
| 107 | + - name: Install Rust |
| 108 | + uses: dtolnay/rust-toolchain@stable |
| 109 | + with: |
| 110 | + toolchain: stable |
| 111 | + components: rustfmt, clippy |
| 112 | + targets: ${{ matrix.target }} |
| 113 | + |
| 114 | + - name: Setup QEMU |
| 115 | + if: matrix.target == 'aarch64-unknown-linux-musl' |
| 116 | + uses: docker/setup-qemu-action@v3 |
| 117 | + with: |
| 118 | + platforms: arm64 |
| 119 | + |
| 120 | + - name: Build wheels (musl) |
| 121 | + uses: PyO3/maturin-action@v1 |
| 122 | + with: |
| 123 | + target: ${{ matrix.target }} |
| 124 | + manylinux: musllinux_1_2 |
| 125 | + args: -i python${{ matrix.python-version }} --out dist -m python/Cargo.toml |
| 126 | + |
| 127 | + - name: Install built wheel |
| 128 | + run: | |
| 129 | + docker run --rm \ |
| 130 | + --platform ${{ matrix.target == 'aarch64-unknown-linux-musl' && 'linux/arm64' || 'linux/amd64' }} \ |
| 131 | + -v $(pwd)/dist:/dist \ |
| 132 | + python:${{ matrix.python-version }}-alpine \ |
| 133 | + sh -c "pip install --upgrade pip && pip install longport --no-index --find-links /dist --force-reinstall && python -c 'import longport'" |
| 134 | +
|
88 | 135 | build-python: |
89 | 136 | needs: |
90 | 137 | - check-python-sdk |
@@ -126,6 +173,40 @@ jobs: |
126 | 173 | name: wheels-${{ matrix.runs-on }}-${{ matrix.python-version }} |
127 | 174 | path: dist |
128 | 175 |
|
| 176 | + build-python-musl: |
| 177 | + needs: |
| 178 | + - check-python-sdk-musl |
| 179 | + runs-on: ubuntu-24.04 |
| 180 | + strategy: |
| 181 | + fail-fast: true |
| 182 | + matrix: |
| 183 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 184 | + target: [x86_64-unknown-linux-musl, aarch64-unknown-linux-musl] |
| 185 | + steps: |
| 186 | + - name: Checkout |
| 187 | + uses: actions/checkout@v4 |
| 188 | + with: |
| 189 | + submodules: true |
| 190 | + - uses: actions/setup-python@v5 |
| 191 | + with: |
| 192 | + python-version: ${{ matrix.python-version }} |
| 193 | + - name: Install Rust toolchain |
| 194 | + uses: dtolnay/rust-toolchain@stable |
| 195 | + with: |
| 196 | + toolchain: stable |
| 197 | + targets: ${{ matrix.target }} |
| 198 | + - name: Build wheels (musl) |
| 199 | + uses: PyO3/maturin-action@v1 |
| 200 | + with: |
| 201 | + target: ${{ matrix.target }} |
| 202 | + manylinux: musllinux_1_2 |
| 203 | + args: -i python${{ matrix.python-version }} --out dist -m python/Cargo.toml |
| 204 | + - name: Upload wheels |
| 205 | + uses: actions/upload-artifact@v4 |
| 206 | + with: |
| 207 | + name: wheels-musl-${{ matrix.target }}-${{ matrix.python-version }} |
| 208 | + path: dist |
| 209 | + |
129 | 210 | check-nodejs-sdk: |
130 | 211 | needs: |
131 | 212 | - check-format |
|
0 commit comments