|
| 1 | +name: deploy python sdk |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | +jobs: |
| 5 | + deploy-python-sdk-linux: |
| 6 | + strategy: |
| 7 | + matrix: |
| 8 | + os: ["ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm"] |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + defaults: |
| 11 | + run: |
| 12 | + working-directory: pgml-sdks/rust/pgml |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + - uses: actions-rs/toolchain@v1 |
| 16 | + with: |
| 17 | + toolchain: stable |
| 18 | + - name: Validate cargo is working |
| 19 | + uses: postgresml/gh-actions-cargo@master |
| 20 | + with: |
| 21 | + command: version |
| 22 | + - name: Install dependencies |
| 23 | + env: |
| 24 | + DEBIAN_FRONTEND: noninteractive |
| 25 | + TZ: Etc/UTC |
| 26 | + run: | |
| 27 | + sudo apt update |
| 28 | + sudo apt-get -y install software-properties-common |
| 29 | + sudo add-apt-repository -y ppa:deadsnakes/ppa |
| 30 | + sudo add-apt-repository -y ppa:apt-fast/stable |
| 31 | + sudo apt update |
| 32 | + sudo apt-get -y install apt-fast |
| 33 | + sudo apt-fast -y install \ |
| 34 | + python3.8 python3.8-dev \ |
| 35 | + python3.9 python3.9-dev \ |
| 36 | + python3.10 python3.10-dev \ |
| 37 | + python3.11 python3.11-dev \ |
| 38 | + python3-pip \ |
| 39 | + git |
| 40 | + pip install maturin |
| 41 | + pip install patchelf |
| 42 | + - name: Create dist directory |
| 43 | + run: mkdir ../../python/dist |
| 44 | + - name: Build wheels |
| 45 | + run: maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist |
| 46 | + - name: Deploy wheels |
| 47 | + env: |
| 48 | + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 49 | + working-directory: pgml-sdks/python/pgml |
| 50 | + run: maturin upload --skip-existing dist/* |
| 51 | + deploy-python-sdk-mac: |
| 52 | + runs-on: macos-latest |
| 53 | + defaults: |
| 54 | + run: |
| 55 | + working-directory: pgml-sdks/rust/pgml |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v3 |
| 58 | + - uses: actions-rs/toolchain@v1 |
| 59 | + with: |
| 60 | + toolchain: stable |
| 61 | + - name: Validate cargo is working |
| 62 | + uses: postgresml/gh-actions-cargo@master |
| 63 | + with: |
| 64 | + command: version |
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + brew update |
| 68 | + brew install python@3.8 |
| 69 | + brew install python@3.9 |
| 70 | + brew install python@3.10 |
| 71 | + brew install python@3.11 |
| 72 | + pip3 install maturin |
| 73 | + - name: Create dist directory |
| 74 | + run: mkdir ../../python/dist |
| 75 | + - name: Build wheels |
| 76 | + run: maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist |
| 77 | + - name: Deploy wheels |
| 78 | + env: |
| 79 | + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 80 | + working-directory: pgml-sdks/python/pgml |
| 81 | + run: maturin upload --skip-existing dist/* |
| 82 | + deploy-python-sdk-windows: |
| 83 | + runs-on: windows-latest |
| 84 | + strategy: |
| 85 | + matrix: |
| 86 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 87 | + defaults: |
| 88 | + run: |
| 89 | + working-directory: pgml-sdks\rust\pgml |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@v3 |
| 92 | + - uses: actions-rs/toolchain@v1 |
| 93 | + with: |
| 94 | + toolchain: stable |
| 95 | + - name: Validate cargo is working |
| 96 | + uses: postgresml/gh-actions-cargo@master |
| 97 | + with: |
| 98 | + command: version |
| 99 | + - name: Set up Python ${{ matrix.python-version }} |
| 100 | + uses: actions/setup-python@v4 |
| 101 | + with: |
| 102 | + python-version: ${{ matrix.python-version }} |
| 103 | + - name: Install dependencies |
| 104 | + run: | |
| 105 | + python -m pip install --upgrade pip |
| 106 | + pip3 install maturin |
| 107 | + - name: Create dist directory |
| 108 | + run: mkdir ..\..\python\dist |
| 109 | + - name: Build wheels |
| 110 | + run: maturin build --release --strip -o ..\..\python\pgml\dist |
| 111 | + - name: Deploy wheels |
| 112 | + env: |
| 113 | + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 114 | + working-directory: pgml-sdks\python\pgml |
| 115 | + run: maturin upload --skip-existing dist\* |
0 commit comments