diff --git a/.github/workflows/build-libraries.yaml b/.github/workflows/build-libraries.yaml index c5016c2..703c003 100644 --- a/.github/workflows/build-libraries.yaml +++ b/.github/workflows/build-libraries.yaml @@ -65,6 +65,65 @@ jobs: name: ${{ env.ARTIFACT_NAME }} path: hdf5/${{ env.ARTIFACT_NAME }}.tar.gz + build_macosx_x86_64: + name: Build MacOSX (x86_64) + runs-on: macOS-11 + env: + ARTIFACT_NAME: macosx_x86_64 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up CMake + uses: lukka/get-cmake@latest + + - name: Install wget + run: brew install wget + + - name: Run the build + run: | + git config --global --add safe.directory $(pwd) + ./build.sh "${ARTIFACT_NAME}" + + - name: Upload tarball + uses: actions/upload-artifact@v3 + with: + name: ${{ env.ARTIFACT_NAME }} + path: hdf5/${{ env.ARTIFACT_NAME }}.tar.gz + + build_macosx_arm64: + name: Build MacOSX (arm64) + runs-on: macOS-11 + env: + ARTIFACT_NAME: macosx_arm64 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + + - name: Set up CMake + uses: brew install cmake + + - name: Install wget + run: brew install wget + + - name: Run the build + run: | + git config --global --add safe.directory $(pwd) + ./build.sh "${ARTIFACT_NAME}" "-DCMAKE_OSX_ARCHITECTURES=arm64" + + - name: Upload tarball + uses: actions/upload-artifact@v3 + with: + name: ${{ env.ARTIFACT_NAME }} + path: hdf5/${{ env.ARTIFACT_NAME }}.tar.gz + publish: name: Publish libraries needs: [build_manylinux_x86_64, build_musllinux_x86_64] diff --git a/build.sh b/build.sh index c9c29d0..c656141 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,9 @@ set -e set -u + output=$1 # output file name for the CPack bundle. +options=${2:-""} mkdir -p installs @@ -10,7 +12,7 @@ mkdir -p installs wget http://zlib.net/fossils/zlib-1.3.tar.gz -O zlib.tar.gz tar -xvf zlib.tar.gz cd zlib-1.3 -cmake -S . -B build -DCMAKE_INSTALL_PREFIX=../installs +cmake -S . -B build -DCMAKE_INSTALL_PREFIX=../installs ${options} cmake --build build cmake --install build cd - @@ -19,7 +21,7 @@ cd - git clone https://gitlab.dkrz.de/k202009/libaec cd libaec git checkout v1.0.6 -cmake -S . -B build -DCMAKE_INSTALL_PREFIX=../installs +cmake -S . -B build -DCMAKE_INSTALL_PREFIX=../installs ${options} cmake --build build cmake --install build cd - @@ -45,7 +47,8 @@ cmake -S . -B build \ -DZLIB_LIBRARY=${cwd}/installs/lib/libz.a \ -DSZIP_INCLUDE_DIR=${cwd}/installs/include \ -DSZIP_LIBRARY=${cwd}/installs/lib/libsz.a \ - -DCPACK_PACKAGE_FILE_NAME=${output} + -DCPACK_PACKAGE_FILE_NAME=${output} \ + ${options} cmake --build build cpack -G TGZ --config build/CPackConfig.cmake