-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathbuild.yml
More file actions
138 lines (123 loc) · 3.76 KB
/
build.yml
File metadata and controls
138 lines (123 loc) · 3.76 KB
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
on:
push:
paths:
- ".github/workflows/**"
- "packages/basemap/**"
- "packages/basemap_data/**"
- "packages/basemap_data_hires/**"
pull_request:
paths:
- ".github/workflows/**"
- "packages/basemap/**"
- "packages/basemap_data/**"
- "packages/basemap_data_hires/**"
workflow_dispatch:
jobs:
build_data:
name: Build data packages
strategy:
matrix:
package: [basemap_data, basemap_data_hires]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Build sdist and wheels
run: |
cd packages/${{ matrix.package }}
python -m pip install build wheel
python -m build --sdist --wheel
- uses: actions/upload-artifact@v4
with:
path: |
packages/${{ matrix.package }}/dist/*.tar.gz
packages/${{ matrix.package }}/dist/*.whl
name: dist-${{ matrix.package }}
build_basemap:
name: Build basemap package (${{ matrix.os }})
needs: [build_data]
strategy:
matrix:
os: [ubuntu-22.04, windows-2019, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Build sdist
if: matrix.os == 'ubuntu-22.04'
run: |
cd packages/basemap
python -m pip install build
python -m build --sdist
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_ARCHS: "native"
CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*"
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "*-musllinux_*"
CIBW_BEFORE_ALL: "python {project}/.github/workflows/run_before_all.py"
CIBW_TEST_EXTRAS: "test"
CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap"
CIBW_ENVIRONMENT: >-
GEOS_VERSION="3.6.5"
GEOS_DIR="$(pwd)/extern"
GEOS_NJOBS=4
PIP_PREFER_BINARY=1
PYTHONUNBUFFERED=1
LD_LIBRARY_PATH="${GEOS_DIR}/lib"
# LD_LIBRARY_PATH in environment is needed by
# auditwheel (Linux) and delocate (MacOS).
with:
package-dir: "packages/basemap"
output-dir: "packages/basemap/dist"
- uses: actions/upload-artifact@v4
with:
path: |
packages/basemap/dist/*.tar.gz
packages/basemap/dist/*.whl
name: dist-basemap-${{ matrix.os }}
check:
name: Check packages
needs: [build_data, build_basemap]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: "dist-*"
merge-multiple: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Check packages with twine
run: |
python -m pip install twine
python -m twine check dist/*.tar.gz
python -m twine check dist/*.whl
upload:
name: Upload packages
needs: [build_data, build_basemap, check]
runs-on: ubuntu-22.04
environment: PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: "dist-*"
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
repository-url: ${{ secrets.PYPI_REPOSITORY_URL }}
skip-existing: true