-
Notifications
You must be signed in to change notification settings - Fork 27
138 lines (138 loc) · 4.83 KB
/
publish.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
136
137
138
name: Build and publish
on:
release:
types: [published]
jobs:
deploy-windows:
runs-on: windows-2019
strategy:
matrix:
python-major-version: [3]
python-minor-version: [7, 8, 9, 10, 11, 12]
env:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install setuptools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine Cython
- name: Install Numpy 1.19.5
if: ${{ matrix.python-minor-version < 10 }}
run: pip install numpy==1.19.5
- name: Install Numpy 1.21.5
if: ${{ matrix.python-minor-version == 10 }}
run: pip install numpy==1.21.5
- name: Install Numpy
if: ${{ matrix.python-minor-version > 10 }}
run: pip install numpy
- name: Build 3_10
if: ${{ matrix.python-minor-version == 10 }}
run: python setup.py sdist bdist_wheel
- name: Build
if: ${{ matrix.python-minor-version != 10 }}
run: python setup.py bdist_wheel
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
deploy-manylinux2010:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["cp36-cp36m", "cp37-cp37m", "cp38-cp38", "cp39-cp39"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Build
run: |
export PYTHON_BIN="/opt/python/${{ matrix.python-version }}/bin"
docker run --rm -v $(pwd):/work \
-w /work quay.io/pypa/manylinux2010_x86_64 \
/bin/sh -c "\
$PYTHON_BIN/pip install numpy==1.19.5 Cython && \
$PYTHON_BIN/python setup.py bdist_wheel && \
cd dist && auditwheel repair *.whl"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/wheelhouse/*
deploy-manylinux_2_24:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["cp310-cp310", "cp311-cp311"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Build
run: |
export PYTHON_BIN="/opt/python/${{ matrix.python-version }}/bin"
docker run --rm -v $(pwd):/work \
-w /work quay.io/pypa/manylinux_2_24_x86_64 \
/bin/sh -c "\
$PYTHON_BIN/pip install numpy Cython && \
$PYTHON_BIN/python setup.py bdist_wheel && \
cd dist && auditwheel repair *.whl"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/wheelhouse/*
deploy-manylinux_2_28:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["cp312-cp312"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Build
run: |
export PYTHON_BIN="/opt/python/${{ matrix.python-version }}/bin"
docker run --rm -v $(pwd):/work \
-w /work quay.io/pypa/manylinux_2_28_x86_64 \
/bin/sh -c "\
$PYTHON_BIN/pip install numpy Cython && \
$PYTHON_BIN/python setup.py bdist_wheel && \
cd dist && auditwheel repair *.whl"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/wheelhouse/*