build linux wheels with manylinux_2_28 for wider glibc compat (#18)
* build linux wheels inside manylinux_2_28 for glibc 2.28 compat Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * add perl-IPC-Cmd for openssl build in manylinux Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
27
.github/workflows/release.yml
vendored
27
.github/workflows/release.yml
vendored
@@ -6,43 +6,48 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: build - ${{ matrix.runs-on }}
|
name: build - ${{ matrix.platform }}
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
|
include:
|
||||||
|
- platform: linux-x86_64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- platform: linux-arm64
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
- platform: macos
|
||||||
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
|
if: runner.os != 'Linux'
|
||||||
with:
|
with:
|
||||||
python-version: "3.14"
|
python-version: "3.14"
|
||||||
|
|
||||||
- name: Install build dependencies
|
- name: Build wheels
|
||||||
run: ./setup.sh
|
run: ./build_wheels.sh dist/
|
||||||
|
|
||||||
- name: build and release wheels
|
- name: Upload releases
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
pip install build
|
|
||||||
|
|
||||||
for toml in */pyproject.toml; do
|
for toml in */pyproject.toml; do
|
||||||
[ -f "$toml" ] || continue
|
[ -f "$toml" ] || continue
|
||||||
pkg="$(dirname "$toml")"
|
pkg="$(dirname "$toml")"
|
||||||
|
module="${pkg//-/_}"
|
||||||
version=$(python3 -c "import tomllib; print(tomllib.load(open('$toml', 'rb'))['project']['version'])")
|
version=$(python3 -c "import tomllib; print(tomllib.load(open('$toml', 'rb'))['project']['version'])")
|
||||||
tag="${pkg}/v${version}"
|
tag="${pkg}/v${version}"
|
||||||
|
|
||||||
echo "========================================="
|
echo "========================================="
|
||||||
echo "Building: $pkg v$version"
|
echo "Uploading: $pkg v$version"
|
||||||
echo "========================================="
|
echo "========================================="
|
||||||
python -m build --wheel "$pkg"
|
|
||||||
|
|
||||||
whl=$(ls "$pkg"/dist/*.whl)
|
whl=$(ls dist/${module}-${version}-*.whl 2>/dev/null) || continue
|
||||||
echo "Uploading: $whl"
|
echo "Wheel: $whl"
|
||||||
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" &>/dev/null; then
|
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" &>/dev/null; then
|
||||||
gh release upload "$tag" "$whl" --repo "$GITHUB_REPOSITORY" --clobber
|
gh release upload "$tag" "$whl" --repo "$GITHUB_REPOSITORY" --clobber
|
||||||
else
|
else
|
||||||
|
|||||||
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -22,16 +22,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
|
if: runner.os != 'Linux'
|
||||||
with:
|
with:
|
||||||
python-version: "3.14"
|
python-version: "3.14"
|
||||||
- name: Install build dependencies
|
|
||||||
run: ./setup.sh
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
run: |
|
run: ./build_wheels.sh dist/
|
||||||
for pkg in */pyproject.toml; do
|
- name: Smoketest
|
||||||
pip wheel "./$(dirname "$pkg")" --no-deps --wheel-dir dist/
|
|
||||||
done
|
|
||||||
- name: Smoketest locally
|
|
||||||
run: bash smoketest.sh dist/
|
run: bash smoketest.sh dist/
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -51,6 +47,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
- image: ubuntu:24.04
|
- image: ubuntu:24.04
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
- image: ubuntu:20.04
|
||||||
|
runs-on: ubuntu-latest
|
||||||
- image: fedora:41
|
- image: fedora:41
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
- image: archlinux:latest
|
- image: archlinux:latest
|
||||||
|
|||||||
33
build_wheels.sh
Executable file
33
build_wheels.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
WHEEL_DIR="${1:-dist}"
|
||||||
|
|
||||||
|
# on Linux, build inside manylinux_2_28 container for glibc 2.28 compatibility.
|
||||||
|
# for reference, Ubuntu 20.04 is glibc 2.31, so this gives us wide compatibility.
|
||||||
|
if [ "$(uname)" = "Linux" ] && [ -z "${MANYLINUX:-}" ]; then
|
||||||
|
ARCH="$(uname -m)"
|
||||||
|
IMAGE="quay.io/pypa/manylinux_2_28_${ARCH}"
|
||||||
|
exec docker run --rm \
|
||||||
|
-e MANYLINUX=1 \
|
||||||
|
-v "$DIR:/work" \
|
||||||
|
-w /work \
|
||||||
|
"$IMAGE" \
|
||||||
|
bash build_wheels.sh "$WHEEL_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set up Python inside manylinux container
|
||||||
|
if [ -n "${MANYLINUX:-}" ]; then
|
||||||
|
export PATH="/opt/python/cp312-cp312/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
./setup.sh
|
||||||
|
pip install setuptools wheel
|
||||||
|
|
||||||
|
mkdir -p "$WHEEL_DIR"
|
||||||
|
for pkg in */pyproject.toml; do
|
||||||
|
pip wheel "./$(dirname "$pkg")" --no-deps --wheel-dir "$WHEEL_DIR"/
|
||||||
|
done
|
||||||
4
setup.sh
4
setup.sh
@@ -3,6 +3,8 @@ set -euo pipefail
|
|||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
brew install nasm pkg-config
|
brew install nasm pkg-config
|
||||||
else
|
elif command -v dnf &>/dev/null; then
|
||||||
|
dnf install -y nasm cmake gcc-c++ pkgconfig git perl-IPC-Cmd
|
||||||
|
elif command -v apt-get &>/dev/null; then
|
||||||
sudo apt-get update && sudo apt-get install -y nasm cmake g++ pkg-config
|
sudo apt-get update && sudo apt-get install -y nasm cmake g++ pkg-config
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user