Skip to content

Commit a484b3f

Browse files
authored
Added binary builds for windows. (#1)
This uses a dedicated build script because of all the slight differences (config vs CMAKE_BUILD_TYPE, needs zlib). We also trial a new approach where we just pack up the entire installation directory rather than cpacking each lib individually, given that the zlib source doesn't support cpack.
1 parent 6034425 commit a484b3f

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

.github/workflows/build-libraries.yaml

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build libraries
22

33
on:
4+
push:
45
create:
56
tags:
67
- '*'
@@ -38,9 +39,30 @@ jobs:
3839
with:
3940
path: artifacts/*.tar.gz
4041

42+
build_windows_x86_64:
43+
name: Build Windows (x86_64)
44+
runs-on: windows-2019
45+
env:
46+
ARTIFACT_NAME: windows_x86_64
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
52+
- name: Run the build
53+
run: |
54+
git config --global --add safe.directory $(pwd)
55+
./build_windows.sh
56+
shell: bash
57+
58+
- name: Upload tarballs
59+
uses: actions/upload-artifact@v3
60+
with:
61+
path: installed
62+
4163
publish:
4264
name: Publish libraries
43-
needs: [build_macosx_x86_64]
65+
needs: [build_macosx_x86_64, build_windows_x86_64]
4466
if: startsWith(github.ref, 'refs/tags/')
4567
runs-on: ubuntu-latest
4668

build_windows.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -u
5+
6+
mkdir installed
7+
install_dir=$(pwd)/installed
8+
9+
# Setting up ZLIB
10+
curl https://www.zlib.net/zlib-1.3.tar.gz > bundle.tar.gz
11+
tar -xf bundle.tar.gz
12+
rm bundle.tar.gz
13+
mv zlib-1.3 libz
14+
15+
cd libz
16+
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${install_dir}
17+
cmake --build build --config Release
18+
cmake --install build
19+
cd -
20+
21+
# Setting up AEC
22+
git clone https://gitlab.dkrz.de/k202009/libaec
23+
cd libaec
24+
git checkout v1.0.6
25+
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${install_dir}
26+
cmake --build build --config Release
27+
cmake --install build
28+
cd -
29+
30+
# Setting up HDF5
31+
curl -L https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_2.tar.gz > bundle.tar.gz
32+
tar -xf bundle.tar.gz
33+
rm bundle.tar.gz
34+
mv hdf5-hdf5-1_12_2/ libhdf5
35+
cd libhdf5
36+
37+
cmake -S . -B build \
38+
-DBUILD_SHARED_LIBS=ON \
39+
-DCMAKE_BUILD_TYPE=Release \
40+
-DHDF5_BUILD_EXAMPLES=OFF \
41+
-DHDF5_BUILD_TOOLS=OFF \
42+
-DHDF5_BUILD_UTILS=OFF \
43+
-DHDF5_BUILD_CPP_LIB=ON \
44+
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
45+
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
46+
-DBUILD_TESTING=OFF \
47+
-DUSE_LIBAEC=ON \
48+
-DCMAKE_INSTALL_PREFIX=${install_dir}
49+
50+
cmake --build build --config Release
51+
cmake --install build
52+
cd -
53+
54+

0 commit comments

Comments
 (0)