1
1
name : deploy python sdk
2
2
on :
3
3
workflow_dispatch :
4
+ inputs :
5
+ deploy_to_pypi :
6
+ description : " Whether to deploy to PyPI (true) or TestPyPI (false)"
7
+ required : false
8
+ default : " false"
4
9
jobs :
5
10
deploy-python-sdk-linux :
6
11
strategy :
@@ -24,31 +29,33 @@ jobs:
24
29
DEBIAN_FRONTEND : noninteractive
25
30
TZ : Etc/UTC
26
31
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.7 python3.7-dev \
35
- python3.8 python3.8-dev \
36
- python3.9 python3.9-dev \
37
- python3.10 python3.10-dev \
38
- python3.11 python3.11-dev \
39
- python3-pip \
40
- git
41
- pip install maturin
42
- pip install patchelf
43
- - name : Create dist directory
44
- run : mkdir ../../python/dist
45
- - name : Build wheels
46
- run : maturin build --release --strip -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist -F python
47
- - name : Deploy wheels
32
+ sudo apt update
33
+ sudo apt-get -y install software-properties-common
34
+ sudo add-apt-repository -y ppa:deadsnakes/ppa
35
+ sudo add-apt-repository -y ppa:apt-fast/stable
36
+ sudo apt update
37
+ sudo apt-get -y install apt-fast
38
+ sudo apt-fast -y install \
39
+ python3.7 python3.7-dev \
40
+ python3.8 python3.8-dev \
41
+ python3.9 python3.9-dev \
42
+ python3.10 python3.10-dev \
43
+ python3.11 python3.11-dev \
44
+ python3-pip \
45
+ git
46
+ pip install maturin
47
+ pip install patchelf
48
+ - name : Build and deploy wheels to TestPyPI
49
+ if : github.event.inputs.deploy_to_pypi == 'false'
50
+ env :
51
+ MATURIN_PYPI_TOKEN : ${{ secrets.TEST_PYPI_API_TOKEN }}
52
+ run : maturin publish -r testpypi -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python
53
+ - name : Build and deploy wheels to PyPI
54
+ if : github.event.inputs.deploy_to_pypi == 'true'
48
55
env :
49
56
MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
50
- working-directory : pgml-sdks/ python/pgml
51
- run : maturin upload --skip-existing dist/*
57
+ run : maturin publish -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python
58
+
52
59
deploy-python-sdk-mac :
53
60
runs-on : macos-latest
54
61
defaults :
@@ -72,15 +79,17 @@ jobs:
72
79
brew install python@3.10
73
80
brew install python@3.11
74
81
pip3 install maturin
75
- - name : Create dist directory
76
- run : mkdir ../../python/dist
77
- - name : Build wheels
78
- run : maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist -F python
79
- - name : Deploy wheels
82
+ - name : Build and deploy wheels to TestPyPI
83
+ if : github.event.inputs.deploy_to_pypi == 'false'
84
+ env :
85
+ MATURIN_PYPI_TOKEN : ${{ secrets.TEST_PYPI_API_TOKEN }}
86
+ run : maturin publish -r testpypi -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python
87
+ - name : Build and deploy wheels to PyPI
88
+ if : github.event.inputs.deploy_to_pypi == 'true'
80
89
env :
81
90
MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
82
- working-directory : pgml-sdks/ python/pgml
83
- run : maturin upload --skip-existing dist/*
91
+ run : maturin publish -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python
92
+
84
93
deploy-python-sdk-windows :
85
94
runs-on : windows-latest
86
95
strategy :
@@ -101,17 +110,18 @@ jobs:
101
110
- name : Set up Python ${{ matrix.python-version }}
102
111
uses : actions/setup-python@v4
103
112
with :
104
- python-version : ${{ matrix.python-version }}
113
+ python-version : ${{ matrix.python-version }}
105
114
- name : Install dependencies
106
115
run : |
107
116
python -m pip install --upgrade pip
108
117
pip3 install maturin
109
- - name : Create dist directory
110
- run : mkdir ..\..\python\dist
111
- - name : Build wheels
112
- run : maturin build --release --strip -o ..\..\python\pgml\dist -F python
113
- - name : Deploy wheels
118
+ - name : Build and deploy wheels to TestPyPI
119
+ if : github.event.inputs.deploy_to_pypi == 'false'
120
+ env :
121
+ MATURIN_PYPI_TOKEN : ${{ secrets.TEST_PYPI_API_TOKEN }}
122
+ run : maturin publish -r testpypi -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python
123
+ - name : Build and deploy wheels to PyPI
124
+ if : github.event.inputs.deploy_to_pypi == 'true'
114
125
env :
115
126
MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
116
- working-directory : pgml-sdks\python\pgml
117
- run : maturin upload --skip-existing dist\*
127
+ run : maturin publish -i python3.8 -i python3.9 -i python3.10 -i python3.11 --skip-existing -F python
0 commit comments