|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
| 4 | + workflow_dispatch: |
5 | 5 |
|
6 | 6 | permissions: |
7 | | - contents: read |
| 7 | + contents: read |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build: |
11 | | - name: Build wheels (${{ matrix.platform.id }}) |
12 | | - runs-on: ${{ matrix.platform.runner }} |
13 | | - strategy: |
14 | | - fail-fast: false |
15 | | - matrix: |
16 | | - platform: |
17 | | - # manylinux_2_28 x86_64 (cp310-cp313) |
18 | | - - id: manylinux_2_28-x86_64 |
19 | | - runner: ubuntu-22.04 |
20 | | - target: x86_64-unknown-linux-gnu |
21 | | - manylinux: "2_28" |
22 | | - maturin_args: >- |
23 | | - --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi |
24 | | - -i python3.10 -i python3.11 -i python3.12 -i python3.13 |
25 | | -
|
26 | | - # manylinux_2_28 aarch64 (cp310-cp313) |
27 | | - - id: manylinux_2_28-aarch64 |
28 | | - runner: ubuntu-22.04 |
29 | | - target: aarch64-unknown-linux-gnu |
30 | | - manylinux: "2_28" |
31 | | - maturin_args: >- |
32 | | - --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi |
33 | | - -i python3.10 -i python3.11 -i python3.12 -i python3.13 |
34 | | -
|
35 | | - # macOS arm64 (cp310) |
36 | | - - id: macos-arm64-cp310 |
37 | | - runner: macos-14 |
38 | | - target: aarch64-apple-darwin |
39 | | - python: "3.10" |
40 | | - manylinux: "" |
41 | | - maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
42 | | - |
43 | | - # macOS arm64 (cp311) |
44 | | - - id: macos-arm64-cp311 |
45 | | - runner: macos-14 |
46 | | - target: aarch64-apple-darwin |
47 | | - python: "3.11" |
48 | | - manylinux: "" |
49 | | - maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
50 | | - |
51 | | - # macOS arm64 (cp312) |
52 | | - - id: macos-arm64-cp312 |
53 | | - runner: macos-14 |
54 | | - target: aarch64-apple-darwin |
55 | | - python: "3.12" |
56 | | - manylinux: "" |
57 | | - maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
58 | | - |
59 | | - # macOS arm64 (cp313) |
60 | | - - id: macos-arm64-cp313 |
61 | | - runner: macos-14 |
62 | | - target: aarch64-apple-darwin |
63 | | - python: "3.13" |
64 | | - manylinux: "" |
65 | | - maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
66 | | - |
67 | | - steps: |
68 | | - - uses: actions/checkout@v4 |
69 | | - |
70 | | - # Only needed for macOS builds (Linux manylinux builds run inside the container and |
71 | | - # actions/setup-python won't affect those). |
72 | | - - name: Setup Python (macOS only) |
73 | | - if: startsWith(matrix.platform.runner, 'macos') |
74 | | - uses: actions/setup-python@v5 |
75 | | - with: |
76 | | - python-version: ${{ matrix.platform.python }} |
77 | | - |
78 | | - - name: Build wheels |
79 | | - uses: PyO3/maturin-action@v1 |
80 | | - with: |
81 | | - command: build |
82 | | - target: ${{ matrix.platform.target }} |
83 | | - manylinux: ${{ matrix.platform.manylinux }} |
84 | | - args: ${{ matrix.platform.maturin_args }} |
85 | | - |
86 | | - - name: Upload wheels |
87 | | - uses: actions/upload-artifact@v4 |
88 | | - with: |
89 | | - name: wheels-${{ matrix.platform.id }} |
90 | | - path: dist/*.whl |
91 | | - |
92 | | - publish: |
93 | | - runs-on: ubuntu-22.04 |
94 | | - needs: build |
95 | | - environment: release |
96 | | - permissions: |
97 | | - id-token: write |
98 | | - steps: |
99 | | - - uses: actions/download-artifact@v4 |
100 | | - with: |
101 | | - pattern: wheels-* |
102 | | - merge-multiple: true |
103 | | - path: dist/ |
104 | | - |
105 | | - - name: Install uv |
106 | | - uses: astral-sh/setup-uv@v5 |
107 | | - |
108 | | - - name: Publish to PyPI |
109 | | - run: uv publish dist/* |
| 10 | + build: |
| 11 | + name: Build wheels (${{ matrix.platform.id }}) |
| 12 | + runs-on: ${{ matrix.platform.runner }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + platform: |
| 17 | + # manylinux_2_28 x86_64 (cp310-cp313) |
| 18 | + - id: manylinux_2_28-x86_64 |
| 19 | + runner: ubuntu-22.04 |
| 20 | + target: x86_64-unknown-linux-gnu |
| 21 | + manylinux: "2_28" |
| 22 | + maturin_args: >- |
| 23 | + --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi |
| 24 | + -i python3.10 -i python3.11 -i python3.12 -i python3.13 |
| 25 | +
|
| 26 | + # manylinux_2_28 aarch64 (cp310-cp313) |
| 27 | + - id: manylinux_2_28-aarch64 |
| 28 | + runner: ubuntu-22.04 |
| 29 | + target: aarch64-unknown-linux-gnu |
| 30 | + manylinux: "2_28" |
| 31 | + maturin_args: >- |
| 32 | + --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi |
| 33 | + -i python3.10 -i python3.11 -i python3.12 -i python3.13 |
| 34 | +
|
| 35 | + # macOS arm64 (cp310) |
| 36 | + - id: macos-arm64-cp310 |
| 37 | + runner: macos-14 |
| 38 | + target: aarch64-apple-darwin |
| 39 | + python: "3.10" |
| 40 | + manylinux: "" |
| 41 | + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
| 42 | + |
| 43 | + # macOS arm64 (cp311) |
| 44 | + - id: macos-arm64-cp311 |
| 45 | + runner: macos-14 |
| 46 | + target: aarch64-apple-darwin |
| 47 | + python: "3.11" |
| 48 | + manylinux: "" |
| 49 | + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
| 50 | + |
| 51 | + # macOS arm64 (cp312) |
| 52 | + - id: macos-arm64-cp312 |
| 53 | + runner: macos-14 |
| 54 | + target: aarch64-apple-darwin |
| 55 | + python: "3.12" |
| 56 | + manylinux: "" |
| 57 | + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
| 58 | + |
| 59 | + # macOS arm64 (cp313) |
| 60 | + - id: macos-arm64-cp313 |
| 61 | + runner: macos-14 |
| 62 | + target: aarch64-apple-darwin |
| 63 | + python: "3.13" |
| 64 | + manylinux: "" |
| 65 | + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python |
| 66 | + |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + |
| 70 | + # Only needed for macOS builds (Linux manylinux builds run inside the container and |
| 71 | + # actions/setup-python won't affect those). |
| 72 | + - name: Setup Python (macOS only) |
| 73 | + if: startsWith(matrix.platform.runner, 'macos') |
| 74 | + uses: actions/setup-python@v5 |
| 75 | + with: |
| 76 | + python-version: ${{ matrix.platform.python }} |
| 77 | + |
| 78 | + - name: Build wheels |
| 79 | + uses: PyO3/maturin-action@v1 |
| 80 | + with: |
| 81 | + command: build |
| 82 | + target: ${{ matrix.platform.target }} |
| 83 | + manylinux: ${{ matrix.platform.manylinux }} |
| 84 | + args: ${{ matrix.platform.maturin_args }} |
| 85 | + |
| 86 | + - name: Upload wheels |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: wheels-${{ matrix.platform.id }} |
| 90 | + path: dist/*.whl |
| 91 | + |
| 92 | + publish-crate: |
| 93 | + runs-on: ubuntu-22.04 |
| 94 | + environment: release |
| 95 | + needs: build |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@v4 |
| 98 | + - uses: prefix-dev/setup-pixi@v0.9.1 |
| 99 | + with: |
| 100 | + pixi-version: v0.63.2 |
| 101 | + - name: Publish to crates.io |
| 102 | + run: pixi run cargo publish -p booster_sdk |
| 103 | + env: |
| 104 | + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 105 | + |
| 106 | + publish-pypi: |
| 107 | + runs-on: ubuntu-22.04 |
| 108 | + needs: build |
| 109 | + environment: release |
| 110 | + permissions: |
| 111 | + id-token: write |
| 112 | + steps: |
| 113 | + - uses: actions/download-artifact@v4 |
| 114 | + with: |
| 115 | + pattern: wheels-* |
| 116 | + merge-multiple: true |
| 117 | + path: dist/ |
| 118 | + |
| 119 | + - name: Install uv |
| 120 | + uses: astral-sh/setup-uv@v5 |
| 121 | + |
| 122 | + - name: Publish to PyPI |
| 123 | + run: uv publish dist/* |
0 commit comments