@@ -18,11 +18,11 @@ jobs:
1818 name : Build source distribution
1919 runs-on : ubuntu-22.04
2020 steps :
21- - uses : actions/checkout@v4
21+ - uses : actions/checkout@v6
2222 with :
2323 fetch-depth : 0
2424
25- - uses : actions/setup-python@v5
25+ - uses : actions/setup-python@v6
2626 name : Install Python
2727 with :
2828 python-version : 3.x
3838 pip install build
3939 && python -m build --sdist . --outdir dist
4040
41- - uses : actions/upload-artifact@v4
41+ - uses : actions/upload-artifact@v6
4242 with :
4343 name : pypi-artifacts
4444 path : ${{ github.workspace }}/dist/*.tar.gz
@@ -55,17 +55,11 @@ jobs:
5555 include :
5656 - os : ubuntu-22.04
5757 arch : x86_64
58- - os : ubuntu-22 .04
58+ - os : ubuntu-24 .04-arm
5959 arch : aarch64
60- - os : macos-14
61- arch : arm64
62- CIBW_ENVIRONMENT : MACOSX_DEPLOYMENT_TARGET=14.0
63- - os : macos-12
64- arch : x86_64
65- CIBW_ENVIRONMENT : MACOSX_DEPLOYMENT_TARGET=12.0
6660
6761 steps :
68- - uses : actions/checkout@v4
62+ - uses : actions/checkout@v6
6963 with :
7064 fetch-depth : 0
7165
@@ -80,54 +74,47 @@ jobs:
8074 shell : bash
8175 # On PRs we run only oldest and newest Python versions to reduce CI load.
8276 # Skips pypy and musllinux everywhere.
83- # We are buiding 38 and 312 for now.
77+ # We are building 310, 311 and 314 for now.
78+ # (3.11 is the oldest version for which we support abi3 wheels)
8479 # These needs to rotate every new Python release.
8580 run : |
86- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
87- CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux* cp39-* cp310-* cp311-* cp312-*"
88- else
89- CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux*"
90- fi
91- echo "CIBW_SKIP=$CIBW_SKIP" >> $GITHUB_ENV
92- echo "Setting CIBW_SKIP=$CIBW_SKIP"
81+ set -x
82+ echo "CIBW_BUILD=cp310-* cp311-* cp314-* cp314t-*" >> $GITHUB_ENV
83+ set +x
84+
85+ if : ${{ github.event_name }} == "pull_request"
9386
9487 - name : " Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
95- uses : pypa/cibuildwheel@v3.0.0
88+ uses : pypa/cibuildwheel@v3.3.1
9689 env :
97- CIBW_SKIP : ${{ env.CIBW_SKIP }}
9890 CIBW_ARCHS : ${{ matrix.arch }}
99- CIBW_BUILD_FRONTEND : build
100- CIBW_MANYLINUX_X86_64_IMAGE : ghcr.io/ocefpaf/manylinux2014_x86_64-netcdf
101- CIBW_MANYLINUX_AARCH64_IMAGE : ghcr.io/ocefpaf/manylinux2014_aarch64-netcdf
102- # Emulation testing is slow, testing only latest Python.
103- CIBW_TEST_SKIP : " cp39-*_aarch64 cp310-*_aarch64 cp311-*_aarch64 cp312-*_aarch64"
104- CIBW_ENVIRONMENT : ${{ matrix.CIBW_ENVIRONMENT }}
105- CIBW_BEFORE_BUILD_MACOS : brew install hdf5 netcdf
106- CIBW_TEST_REQUIRES : pytest cython packaging typing-extensions
107- CIBW_TEST_COMMAND : >
108- python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
109- && pytest -s -rxs -v {project}/test
110-
111- - uses : actions/upload-artifact@v4
91+
92+ - uses : actions/upload-artifact@v6
11293 with :
11394 name : pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }}
11495 path : ${{ github.workspace }}/wheelhouse/*.whl
11596
11697
117- build_wheels_windows :
98+ build_wheels_winmac :
11899 name : Build wheels for ${{matrix.arch}} on ${{ matrix.os }}
119100 runs-on : ${{ matrix.os }}
120101 strategy :
102+ fail-fast : false
121103 matrix :
122- os : [windows-latest]
123- arch : [win_amd64]
104+ include :
105+ - os : windows-latest
106+ arch : AMD64
107+ - os : macos-14
108+ arch : arm64
109+ - os : macos-15-intel
110+ arch : x86_64
124111
125112 steps :
126- - uses : actions/checkout@v4
113+ - uses : actions/checkout@v6
127114 with :
128115 fetch-depth : 0
129116
130- - uses : actions/setup-python@v5
117+ - uses : actions/setup-python@v6
131118 name : Install Python
132119 with :
133120 python-version : 3.x
@@ -138,40 +125,65 @@ jobs:
138125 environment-name : build
139126 init-shell : bash
140127 create-args : >-
141- python=${{ matrix.python-version }} libnetcdf=4.9.2 --channel conda-forge
128+ python=${{ matrix.python-version }} libnetcdf=4.9.3 --channel conda-forge
142129
143- - name : Install cibuildwheel
144- run : |
145- python -m pip install --upgrade cibuildwheel delvewheel
146-
147- - name : Build wheels for Windows (${{ matrix.arch }})
148- run : cibuildwheel --output-dir wheelhouse
130+ - name : Build wheels for Windows/Mac
131+ uses : pypa/cibuildwheel@v3.3.1
149132 env :
150- CIBW_BUILD : " cp39-${{ matrix.arch }} cp310-${{ matrix.arch }} cp311-${{ matrix.arch }} cp312-${{ matrix.arch }} cp313-${{ matrix.arch }}"
151- CIBW_ENVIRONMENT_WINDOWS : >
152- HDF5_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
153- netCDF4_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
154- PATH="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library\\bin;${PATH}"
155- CIBW_REPAIR_WHEEL_COMMAND_WINDOWS : >
156- delvewheel show {wheel}
157- && delvewheel repair -w {dest_dir} {wheel}
158- CIBW_TEST_REQUIRES : pytest cython packaging typing-extensions
159- CIBW_TEST_COMMAND : >
160- python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
161- && pytest -s -rxs -v {project}\\test
162-
163- - uses : actions/upload-artifact@v4
133+ CIBW_ARCHS : ${{ matrix.arch }}
134+
135+ - uses : actions/upload-artifact@v6
164136 with :
165137 name : pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }}
166138 path : ${{ github.workspace }}/wheelhouse/*.whl
167139
168140
141+ build_wheels_windows_arm :
142+ name : Build wheels for ARM64 on Windows
143+ runs-on : windows-11-arm
144+ steps :
145+ - uses : actions/checkout@v6
146+ with :
147+ fetch-depth : 0
148+
149+ - uses : actions/setup-python@v6
150+ name : Install Python
151+ with :
152+ python-version : 3.x
153+
154+ - name : Install vcpkg dependencies
155+ shell : pwsh
156+ run : |
157+ # Install vcpkg
158+ git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
159+ cd C:\vcpkg
160+ .\bootstrap-vcpkg.bat
161+
162+ # Install netcdf and dependencies
163+ .\vcpkg.exe install hdf5:arm64-windows netcdf-c:arm64-windows zlib:arm64-windows
164+
165+ # Set environment variables for build
166+ echo "HDF5_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
167+ echo "NETCDF4_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
168+
169+ - name : Build wheels for Windows ARM64
170+ uses : pypa/cibuildwheel@v3.3.1
171+ env :
172+ CIBW_ARCHS : ARM64
173+ CIBW_SKIP : " cp310-*"
174+
175+ - uses : actions/upload-artifact@v6
176+ with :
177+ name : pypi-artifacts-windows-11-arm-ARM64
178+ path : ${{ github.workspace }}/wheelhouse/*.whl
179+
180+
169181 show-artifacts :
170- needs : [build_bdist, build_sdist, build_wheels_windows ]
182+ needs : [build_bdist, build_sdist, build_wheels_winmac, build_wheels_windows_arm ]
171183 name : " Show artifacts"
172184 runs-on : ubuntu-22.04
173185 steps :
174- - uses : actions/download-artifact@v4
186+ - uses : actions/download-artifact@v7
175187 with :
176188 pattern : pypi-artifacts*
177189 path : ${{ github.workspace }}/dist
@@ -183,13 +195,13 @@ jobs:
183195
184196
185197 publish-artifacts-pypi :
186- needs : [build_bdist, build_sdist, build_wheels_windows ]
198+ needs : [build_bdist, build_sdist, build_wheels_winmac, build_wheels_windows_arm ]
187199 name : " Publish to PyPI"
188200 runs-on : ubuntu-22.04
189201 # upload to PyPI for every tag starting with 'v'
190202 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
191203 steps :
192- - uses : actions/download-artifact@v4
204+ - uses : actions/download-artifact@v7
193205 with :
194206 pattern : pypi-artifacts*
195207 path : ${{ github.workspace }}/dist
0 commit comments