-
Notifications
You must be signed in to change notification settings - Fork 285
135 lines (133 loc) · 5 KB
/
python-sdk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: deploy python sdk
on:
workflow_dispatch:
inputs:
deploy_to_pypi:
description: "Whether to deploy to PyPI (true) or TestPyPI (false)"
required: false
default: "false"
jobs:
deploy-python-sdk-linux:
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm"]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: pgml-sdks/pgml
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
sudo apt update
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo add-apt-repository -y ppa:apt-fast/stable
sudo apt update
sudo apt-get -y install apt-fast
sudo apt-fast -y install \
python3.7 python3.7-dev \
python3.8 python3.8-dev \
python3.9 python3.9-dev \
python3.10 python3.10-dev \
python3.11 python3.11-dev \
python3.12 python3.12-dev \
python3-pip \
git
pip install maturin
pip install patchelf
- name: Build and deploy wheels to TestPyPI
if: github.event.inputs.deploy_to_pypi == 'false'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/pgml/pgml.pyi"
run: maturin publish -r testpypi -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
- name: Build and deploy wheels to PyPI
if: github.event.inputs.deploy_to_pypi == 'true'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/pgml/pgml.pyi"
run: maturin publish -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
deploy-python-sdk-mac:
runs-on: macos-latest
defaults:
run:
working-directory: pgml-sdks/pgml
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Install dependencies
run: |
# brew upgrade
# brew update
brew install python@3.8
brew install python@3.9
brew install python@3.10
brew install python@3.11
brew install python@3.12
pip3 install maturin --break-system-packages
- name: Build and deploy wheels to TestPyPI
if: github.event.inputs.deploy_to_pypi == 'false'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/pgml/pgml.pyi"
run: maturin publish -r testpypi -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
- name: Build and deploy wheels to PyPI
if: github.event.inputs.deploy_to_pypi == 'true'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/pgml/pgml.pyi"
run: maturin publish -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
deploy-python-sdk-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
defaults:
run:
working-directory: pgml-sdks\pgml
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install maturin
- name: Build and deploy wheels to TestPyPI
if: github.event.inputs.deploy_to_pypi == 'false'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/pgml/pgml.pyi"
run: maturin publish -r testpypi -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
- name: Build and deploy wheels to PyPI
if: github.event.inputs.deploy_to_pypi == 'true'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/pgml/pgml.pyi"
run: maturin publish -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python