Skip to content

Commit d5470d5

Browse files
committed
Add initial basemap workflow for Windows
1 parent 3f333df commit d5470d5

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: basemap-for-windows
2+
3+
env:
4+
PKGDIR: "packages/basemap"
5+
6+
on:
7+
push:
8+
workflow_dispatch:
9+
10+
jobs:
11+
12+
build-geos:
13+
strategy:
14+
matrix:
15+
arch:
16+
[
17+
"x64",
18+
]
19+
max-parallel: 1
20+
fail-fast: false
21+
runs-on: windows-latest
22+
steps:
23+
-
24+
name: Checkout
25+
uses: actions/checkout@v1
26+
-
27+
name: Set Python
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: "3.6"
31+
architecture: ${{ matrix.arch }}
32+
-
33+
name: Install CMake
34+
uses: jwlawson/[email protected]
35+
with:
36+
cmake-version: "3.16.x"
37+
-
38+
name: Install MSVC toolchain
39+
uses: ilammy/msvc-dev-cmd@v1
40+
with:
41+
arch: ${{ matrix.arch }}
42+
-
43+
name: Build GEOS from source
44+
run: |
45+
cd ${{ env.PKGDIR }}
46+
python -c "import utils; utils.GeosLibrary('3.6.5').build('extern')"
47+
-
48+
name: Upload GEOS artifacts
49+
uses: actions/upload-artifact@v1
50+
with:
51+
name: artifacts-geos-${{ matrix.arch }}
52+
path: ${{ env.PKGDIR }}/extern
53+
54+
build:
55+
strategy:
56+
matrix:
57+
arch:
58+
[
59+
"x64",
60+
]
61+
python-version:
62+
[
63+
"2.7",
64+
"3.5",
65+
"3.6",
66+
"3.7",
67+
"3.8",
68+
"3.9",
69+
]
70+
max-parallel: 6
71+
fail-fast: false
72+
needs: build-geos
73+
runs-on: windows-latest
74+
steps:
75+
-
76+
name: Checkout
77+
uses: actions/checkout@v1
78+
-
79+
name: Download GEOS artifacts
80+
uses: actions/download-artifact@v1
81+
with:
82+
name: artifacts-geos-${{ matrix.arch }}
83+
path: ${{ env.PKGDIR }}/extern
84+
-
85+
name: Set Python
86+
uses: actions/setup-python@v2
87+
with:
88+
python-version: "${{ matrix.python-version }}"
89+
architecture: ${{ matrix.arch }}
90+
-
91+
name: Install MSVC toolchain
92+
uses: ilammy/msvc-dev-cmd@v1
93+
with:
94+
arch: ${{ matrix.arch }}
95+
-
96+
name: Install Python base packages
97+
run: |
98+
python -m pip install --upgrade pip setuptools wheel
99+
-
100+
name: Generate NumPy headers
101+
run: |
102+
if ("${{ matrix.python-version }}" -lt "3.5") {
103+
Set-Variable -Name "pkgvers" -Value "1.11.3"
104+
} else {
105+
Set-Variable -Name "pkgvers" -Value "1.16.6"
106+
}
107+
Set-Variable -Name "pkgname" -Value "numpy"
108+
Set-Variable -Name "pkgcode" -Value "numpy-${pkgvers}"
109+
Set-Variable -Name "includedir" -Value "numpy/core/include"
110+
python -m pip download --no-binary=:all: "numpy == ${pkgvers}"
111+
tar -xf "${pkgcode}.zip"
112+
rm "${pkgcode}.zip"
113+
cd "${pkgcode}"
114+
python setup.py build
115+
cp -R build/src.*/${includedir}/numpy/*.h ${includedir}/numpy
116+
cd ..
117+
cp -R "${pkgcode}/${includedir}/numpy" "${{ env.PKGDIR }}/extern/include/numpy"
118+
rm -r "${pkgcode}"
119+
-
120+
name: Build wheel
121+
run: |
122+
cd ${{ env.PKGDIR }}
123+
$env:GEOS_DIR = "extern"
124+
$env:NUMPY_INCLUDE_PATH = "extern/include"
125+
pip install -r requirements-setup.txt
126+
python setup.py sdist bdist_wheel
127+
-
128+
name: Upload build artifacts
129+
uses: actions/upload-artifact@v1
130+
with:
131+
name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }}
132+
path: ${{ env.PKGDIR }}/dist

0 commit comments

Comments
 (0)