|
| 1 | +# This file is autogenerated by maturin v1.7.8 |
| 2 | +# To update, run |
| 3 | +# |
| 4 | +# maturin generate-ci github -m crates/py_client/Cargo.toml |
| 5 | +# |
| 6 | +name: Python Client Build |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + - master |
| 13 | + tags: |
| 14 | + - "convex-py/*" |
| 15 | + pull_request: |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + linux: |
| 23 | + runs-on: ${{ matrix.platform.runner }} |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + platform: |
| 27 | + - runner: ubuntu-22.04 |
| 28 | + target: x86_64 |
| 29 | + - runner: ubuntu-22.04 |
| 30 | + target: x86 |
| 31 | + - runner: ubuntu-22.04 |
| 32 | + target: aarch64 |
| 33 | + - runner: ubuntu-22.04 |
| 34 | + target: armv7 |
| 35 | + - runner: ubuntu-22.04 |
| 36 | + target: s390x |
| 37 | + - runner: ubuntu-22.04 |
| 38 | + target: ppc64le |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + - uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: 3.x |
| 44 | + - name: Build wheels |
| 45 | + uses: PyO3/maturin-action@v1 |
| 46 | + with: |
| 47 | + target: ${{ matrix.platform.target }} |
| 48 | + args: --release --out dist |
| 49 | + sccache: "true" |
| 50 | + manylinux: auto |
| 51 | + before-script-linux: | |
| 52 | + # see https://github.com/sfackler/rust-openssl/issues/2036#issuecomment-1724324145 for discussion of this script |
| 53 | + # If we're running on rhel centos, install needed packages. |
| 54 | + if command -v yum &> /dev/null; then |
| 55 | + yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic |
| 56 | + # If we're running on i686 we need to symlink libatomic |
| 57 | + # in order to build openssl with -latomic flag. |
| 58 | + if [[ ! -d "/usr/lib64" ]]; then |
| 59 | + ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so |
| 60 | + fi |
| 61 | + else |
| 62 | + # If we're running on debian-based system. |
| 63 | + apt update -y && apt-get install -y libssl-dev openssl pkg-config |
| 64 | + fi |
| 65 | + - name: Build free-threaded wheels |
| 66 | + uses: PyO3/maturin-action@v1 |
| 67 | + with: |
| 68 | + target: ${{ matrix.platform.target }} |
| 69 | + args: --release --out dist -i python3.13t |
| 70 | + sccache: "true" |
| 71 | + manylinux: auto |
| 72 | + before-script-linux: | |
| 73 | + if command -v yum &> /dev/null; then |
| 74 | + yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic |
| 75 | + # If we're running on i686 we need to symlink libatomic |
| 76 | + # in order to build openssl with -latomic flag. |
| 77 | + if [[ ! -d "/usr/lib64" ]]; then |
| 78 | + ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so |
| 79 | + fi |
| 80 | + else |
| 81 | + # If we're running on debian-based system. |
| 82 | + apt update -y && apt-get install -y libssl-dev openssl pkg-config |
| 83 | + fi |
| 84 | + - name: Upload wheels |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: wheels-linux-${{ matrix.platform.target }} |
| 88 | + path: dist |
| 89 | + |
| 90 | + musllinux: |
| 91 | + runs-on: ${{ matrix.platform.runner }} |
| 92 | + strategy: |
| 93 | + matrix: |
| 94 | + platform: |
| 95 | + - runner: ubuntu-22.04 |
| 96 | + target: x86_64 |
| 97 | + - runner: ubuntu-22.04 |
| 98 | + target: x86 |
| 99 | + - runner: ubuntu-22.04 |
| 100 | + target: aarch64 |
| 101 | + - runner: ubuntu-22.04 |
| 102 | + target: armv7 |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@v4 |
| 105 | + - uses: actions/setup-python@v5 |
| 106 | + with: |
| 107 | + python-version: 3.x |
| 108 | + - name: Build wheels |
| 109 | + uses: PyO3/maturin-action@v1 |
| 110 | + with: |
| 111 | + target: ${{ matrix.platform.target }} |
| 112 | + args: --release --out dist |
| 113 | + sccache: "true" |
| 114 | + manylinux: musllinux_1_2 |
| 115 | + - name: Build free-threaded wheels |
| 116 | + uses: PyO3/maturin-action@v1 |
| 117 | + with: |
| 118 | + target: ${{ matrix.platform.target }} |
| 119 | + args: --release --out dist -i python3.13t |
| 120 | + sccache: "true" |
| 121 | + manylinux: musllinux_1_2 |
| 122 | + - name: Upload wheels |
| 123 | + uses: actions/upload-artifact@v4 |
| 124 | + with: |
| 125 | + name: wheels-musllinux-${{ matrix.platform.target }} |
| 126 | + path: dist |
| 127 | + |
| 128 | + windows: |
| 129 | + runs-on: ${{ matrix.platform.runner }} |
| 130 | + strategy: |
| 131 | + matrix: |
| 132 | + platform: |
| 133 | + - runner: windows-latest |
| 134 | + target: x64 |
| 135 | + - runner: windows-latest |
| 136 | + target: x86 |
| 137 | + steps: |
| 138 | + - uses: actions/checkout@v4 |
| 139 | + - uses: actions/setup-python@v5 |
| 140 | + with: |
| 141 | + python-version: 3.x |
| 142 | + architecture: ${{ matrix.platform.target }} |
| 143 | + - name: Build wheels |
| 144 | + uses: PyO3/maturin-action@v1 |
| 145 | + with: |
| 146 | + target: ${{ matrix.platform.target }} |
| 147 | + args: --release --out dist |
| 148 | + sccache: "true" |
| 149 | + - name: Build free-threaded wheels |
| 150 | + uses: PyO3/maturin-action@v1 |
| 151 | + with: |
| 152 | + target: ${{ matrix.platform.target }} |
| 153 | + args: --release --out dist --find-interpreter |
| 154 | + sccache: "true" |
| 155 | + - name: Upload wheels |
| 156 | + uses: actions/upload-artifact@v4 |
| 157 | + with: |
| 158 | + name: wheels-windows-${{ matrix.platform.target }} |
| 159 | + path: dist |
| 160 | + |
| 161 | + macos: |
| 162 | + runs-on: ${{ matrix.platform.runner }} |
| 163 | + strategy: |
| 164 | + matrix: |
| 165 | + platform: |
| 166 | + - runner: macos-13 |
| 167 | + target: x86_64 |
| 168 | + - runner: macos-14 |
| 169 | + target: aarch64 |
| 170 | + steps: |
| 171 | + - uses: actions/checkout@v4 |
| 172 | + - uses: actions/setup-python@v5 |
| 173 | + with: |
| 174 | + python-version: 3.x |
| 175 | + - name: Build wheels |
| 176 | + uses: PyO3/maturin-action@v1 |
| 177 | + with: |
| 178 | + target: ${{ matrix.platform.target }} |
| 179 | + args: --release --out dist |
| 180 | + sccache: "true" |
| 181 | + - name: Build free-threaded wheels |
| 182 | + uses: PyO3/maturin-action@v1 |
| 183 | + with: |
| 184 | + target: ${{ matrix.platform.target }} |
| 185 | + args: --release --out dist -i python3.13t |
| 186 | + sccache: "true" |
| 187 | + - name: Upload wheels |
| 188 | + uses: actions/upload-artifact@v4 |
| 189 | + with: |
| 190 | + name: wheels-macos-${{ matrix.platform.target }} |
| 191 | + path: dist |
| 192 | + |
| 193 | + sdist: |
| 194 | + runs-on: ubuntu-latest |
| 195 | + steps: |
| 196 | + - uses: actions/checkout@v4 |
| 197 | + - name: Build sdist |
| 198 | + uses: PyO3/maturin-action@v1 |
| 199 | + with: |
| 200 | + command: sdist |
| 201 | + args: --out dist |
| 202 | + - name: Upload sdist |
| 203 | + uses: actions/upload-artifact@v4 |
| 204 | + with: |
| 205 | + name: wheels-sdist |
| 206 | + path: dist |
| 207 | + |
| 208 | + release: |
| 209 | + name: Release |
| 210 | + runs-on: ubuntu-latest |
| 211 | + if: |
| 212 | + ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == |
| 213 | + 'workflow_dispatch' }} |
| 214 | + needs: [linux, musllinux, windows, macos, sdist] |
| 215 | + permissions: |
| 216 | + # Use to sign the release artifacts |
| 217 | + id-token: write |
| 218 | + # Used to upload release artifacts |
| 219 | + contents: write |
| 220 | + # Used to generate artifact attestation |
| 221 | + attestations: write |
| 222 | + steps: |
| 223 | + - uses: actions/download-artifact@v4 |
| 224 | + - name: Generate artifact attestation |
| 225 | + uses: actions/attest-build-provenance@v1 |
| 226 | + with: |
| 227 | + subject-path: "wheels-*/*" |
| 228 | + - name: Publish to PyPI |
| 229 | + if: ${{ startsWith(github.ref, 'refs/tags/convex-py/') }} |
| 230 | + uses: PyO3/maturin-action@v1 |
| 231 | + env: |
| 232 | + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 233 | + with: |
| 234 | + command: upload |
| 235 | + args: --non-interactive --skip-existing wheels-*/* |
0 commit comments