Skip to content

Commit

Permalink
Upgrade to support newer Python builds (#2)
Browse files Browse the repository at this point in the history
- Switch to newer linux images for muslinux and manylinux
- Bump version of zlib for windows builds
- Add arm64 builds for macos
- build everything through actions
  • Loading branch information
jkanche authored Dec 24, 2024
1 parent 402271b commit 0122528
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build-libraries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,40 @@ name: Build libraries
on:
create:
tags:
- '*-x86_64'
- '*'
pull_request:

jobs:
build_macosx_x86_64:
name: Build MacOSX (x86_64)
runs-on: macOS-11
build_macosx:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, higher macos's are apple silicon
# At some point, maybe get this to work on windows-latest
os: [macos-13, macos-latest]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up CMake
uses: lukka/get-cmake@latest

- name: Run the build
if: matrix.os == 'macos-13'
run: |
git config --global --add safe.directory $(pwd)
./build_macosx.sh "x86_64"
tar -czf macosx_x86_64.tar.gz installed/
- name: Run the build
if: matrix.os == 'macos-latest'
run: |
git config --global --add safe.directory $(pwd)
./build_macosx.sh "arm64"
tar -czf macosx_arm64.tar.gz installed/
- name: Upload tarballs
uses: actions/upload-artifact@v3
with:
Expand All @@ -34,7 +48,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run the build
run: |
Expand All @@ -50,12 +64,12 @@ jobs:

publish:
name: Publish libraries
needs: [build_macosx_x86_64, build_windows_x86_64]
needs: [build_macosx, build_windows_x86_64]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- name: Download macosx (x86_64) artifact
- name: Download macosx artifact
uses: actions/download-artifact@v3
with:
path: dump
Expand All @@ -67,5 +81,5 @@ jobs:
- name: Publish release
uses: softprops/action-gh-release@v1
with:
name: "HDF5 binaries (x86_64)"
name: "HDF5 binaries"
files: dump/*/*
2 changes: 1 addition & 1 deletion .github/workflows/create-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
create:
tags:
- '*-x86_64'
- '*'

name: Create Docker images

Expand Down
2 changes: 1 addition & 1 deletion build_macosx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u

arch=${1}

mkdir installed
mkdir -p installed
install_dir=$(pwd)/installed

common="-DCMAKE_OSX_ARCHITECTURES=${arch} -DCMAKE_INSTALL_PREFIX=${install_dir}"
Expand Down
4 changes: 2 additions & 2 deletions build_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ mkdir installed
install_dir=$(pwd)/installed

# Setting up ZLIB
curl https://www.zlib.net/zlib-1.3.tar.gz > bundle.tar.gz
curl https://www.zlib.net/zlib-1.3.1.tar.gz > bundle.tar.gz
tar -xf bundle.tar.gz
rm bundle.tar.gz
mv zlib-1.3 libz
mv zlib-1.3.1 libz

cd libz
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${install_dir}
Expand Down
2 changes: 1 addition & 1 deletion manylinux_x86_64.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/pypa/manylinux2014_x86_64
FROM quay.io/pypa/manylinux_2_34
WORKDIR /home/root
COPY setup* .
COPY build_linux.sh .
Expand Down
2 changes: 1 addition & 1 deletion musllinux_x86_64.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/pypa/musllinux_1_1_x86_64
FROM quay.io/pypa/musllinux_1_2
WORKDIR /home/root
COPY setup* .
COPY build_linux.sh .
Expand Down

0 comments on commit 0122528

Please sign in to comment.