Skip to content

Commit

Permalink
Added all the Mac builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Oct 14, 2023
1 parent 6fe69e5 commit 6e320fc
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build-libraries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}" "-DCMAKE_OSX_ARCHITECTURES=x86_64"
- 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: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Checkout
uses: actions/checkout@v3

- name: Install CMake
run: 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]
Expand Down
9 changes: 6 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

set -e
set -u

output=$1 # output file name for the CPack bundle.
options=${2:-""}

mkdir -p installs

# Setting up ZLIB
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 -
Expand All @@ -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 -
Expand All @@ -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

0 comments on commit 6e320fc

Please sign in to comment.