-
Notifications
You must be signed in to change notification settings - Fork 124
170 lines (154 loc) · 4.33 KB
/
build.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Build
on:
push:
branches:
- master
paths:
- '.github/workflows/build.yml'
pull_request:
release:
types:
- published
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
conda:
name: Conda ${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
sidx-version: ['1.8.5','1.9.3']
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Setup
shell: bash -l {0}
run: |
conda install -c conda-forge numpy libspatialindex=${{ matrix.sidx-version }} -y
- name: Install
shell: bash -l {0}
run: |
pip install -e .
- name: Test with pytest
shell: bash -l {0}
run: |
pip install pytest
python -m pytest --doctest-modules rtree tests
ubuntu:
name: Ubuntu Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
- name: Setup
shell: bash -l {0}
run: |
sudo apt install libspatialindex-c6 python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install setuptools numpy pytest
- name: Build
shell: bash -l {0}
run: |
python3 -m pip install --user .
- name: Test with pytest
shell: bash -l {0}
run: |
python3 -m pytest --doctest-modules rtree tests
wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
- uses: ilammy/msvc-dev-cmd@v1
if: startsWith(matrix.os, 'windows')
- name: Run Windows Preinstall Build
if: startsWith(matrix.os, 'windows')
run: |
choco install vcpython27 -f -y
ci\install_libspatialindex.bat
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-whl
path: wheelhouse/*.whl
collect-artifacts:
name: Package and push release
#needs: [windows-wheel, linux-wheel, osx-wheel, conda, ubuntu]
needs: [conda, ubuntu, wheels]
runs-on: 'ubuntu-latest'
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
- name: Source
shell: bash -l {0}
run: |
sudo apt install libspatialindex-c6 python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install setuptools numpy pytest wheel
export PATH=$PATH:/home/runner/.local/bin
python3 setup.py sdist
- uses: actions/download-artifact@v4
with:
path: dist
name: Download artifacts
- name: Display structure of downloaded files
run: ls -R
working-directory: dist
- name: Unpack
shell: bash -l {0}
working-directory: dist
run: |
for f in *whl
do
cd "$f"
cp *.whl ..
cd ..
done;
rm -rf *\-whl
ls -al
- uses: pypa/gh-action-pypi-publish@release/v1
name: Publish package
if: github.event_name == 'release' && github.event.action == 'published'
with:
user: __token__
password: ${{ secrets.pypi_token }}
packages_dir: ./dist