|
5 | 5 | - release-python-nodejs |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build-python-sdk: |
9 | | - runs-on: ${{ matrix.runs-on }} |
10 | | - strategy: |
11 | | - fail-fast: true |
12 | | - matrix: |
13 | | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
14 | | - runs-on: |
15 | | - [ |
16 | | - "windows-latest", |
17 | | - "ubuntu-24.04", |
18 | | - "ubuntu-24.04-arm", |
19 | | - "macos-15", |
20 | | - "macos-15-intel", |
21 | | - ] |
22 | | - steps: |
23 | | - - name: Checkout |
24 | | - uses: actions/checkout@v4 |
25 | | - with: |
26 | | - submodules: true |
27 | | - - uses: actions/setup-python@v5 |
28 | | - with: |
29 | | - python-version: ${{ matrix.python-version }} |
30 | | - - name: Install Rust toolchain |
31 | | - uses: dtolnay/rust-toolchain@stable |
32 | | - with: |
33 | | - toolchain: stable |
34 | | - - name: Build wheels |
35 | | - uses: PyO3/maturin-action@v1 |
36 | | - with: |
37 | | - args: -i python --release --out dist -m python/Cargo.toml |
38 | | - - name: Install built wheel |
39 | | - run: | |
40 | | - pip install longbridge --no-index --find-links dist --force-reinstall |
41 | | - - name: Upload wheels |
42 | | - uses: actions/upload-artifact@v4 |
43 | | - with: |
44 | | - name: wheels-${{ matrix.runs-on }}-${{ matrix.python-version }} |
45 | | - path: dist |
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 | | - |
91 | 8 | build-nodejs-sdk: |
92 | 9 | strategy: |
93 | 10 | fail-fast: true |
@@ -139,40 +56,10 @@ jobs: |
139 | 56 | name: bindings-${{ matrix.settings.host }} |
140 | 57 | path: nodejs/longbridge.*.node |
141 | 58 |
|
142 | | - build: |
143 | | - needs: |
144 | | - - build-python-sdk |
145 | | - - build-python-sdk-musl |
146 | | - - build-nodejs-sdk |
147 | | - runs-on: ubuntu-24.04 |
148 | | - steps: |
149 | | - - run: echo "All builds are done" |
150 | | - |
151 | | - publish-python-sdk: |
152 | | - runs-on: ubuntu-24.04 |
153 | | - environment: |
154 | | - name: pypi |
155 | | - url: https://pypi.org/p/longbridge |
156 | | - permissions: |
157 | | - id-token: write |
158 | | - needs: |
159 | | - - build |
160 | | - steps: |
161 | | - - uses: actions/download-artifact@v5 |
162 | | - with: |
163 | | - path: dist |
164 | | - pattern: wheels-* |
165 | | - merge-multiple: true |
166 | | - - uses: actions/setup-python@v5 |
167 | | - with: |
168 | | - python-version: 3.8 |
169 | | - - name: Publish to PyPi |
170 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
171 | | - |
172 | 59 | publish-nodejs-sdk: |
173 | 60 | runs-on: ubuntu-24.04 |
174 | 61 | needs: |
175 | | - - build |
| 62 | + - build-nodejs-sdk |
176 | 63 | steps: |
177 | 64 | - uses: actions/checkout@v4 |
178 | 65 | - name: Update versions |
|
0 commit comments