Skip to content

Commit ce08356

Browse files
committed
ci: build wheel
1 parent e613828 commit ce08356

3 files changed

Lines changed: 37 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Release
22

33
on:
4+
pull_request:
5+
branches: [ main, master, develop ]
46
push:
57
tags:
68
- 'v*.*.*'
@@ -30,7 +32,6 @@ jobs:
3032
echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT
3133
3234
build-wheels:
33-
needs: [extract-version]
3435
strategy:
3536
fail-fast: false
3637
matrix:
@@ -64,8 +65,10 @@ jobs:
6465
retention-days: 7
6566

6667
build-sdist:
67-
needs: [extract-version]
68+
# sdist is platform-agnostic (source distribution), so we only need to build it once
69+
# Use Debian container to avoid package conflicts with Ubuntu runner
6870
runs-on: ubuntu-latest
71+
container: python:3.12-bookworm
6972
permissions:
7073
contents: write
7174
steps:
@@ -74,6 +77,19 @@ jobs:
7477
with:
7578
submodules: recursive
7679

80+
- name: Add Debian sid repository
81+
run: |
82+
echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list.d/sid.list
83+
echo 'Package: *\nPin: release a=sid\nPin-Priority: 100' > /etc/apt/preferences.d/sid
84+
85+
- name: Install system dependencies
86+
run: |
87+
apt-get update
88+
# Ensure /etc/os-release exists (required by some actions' OS detection)
89+
apt-get install -y base-files
90+
apt-get install -y build-essential pkg-config libbz2-dev
91+
apt-get install -y -t sid libmapnik-dev
92+
7793
- name: Install uv
7894
uses: astral-sh/setup-uv@v7
7995

@@ -96,7 +112,7 @@ jobs:
96112
runs-on: ubuntu-latest
97113
permissions:
98114
contents: write
99-
if: github.event_name == 'push'
115+
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'
100116

101117
steps:
102118
- name: Download all artifacts
@@ -117,6 +133,7 @@ jobs:
117133
- name: Create GitHub Release
118134
uses: softprops/action-gh-release@v2
119135
with:
136+
token: ${{ secrets.GITHUB_TOKEN }}
120137
tag_name: ${{ needs.extract-version.outputs.version }}
121138
name: Release ${{ needs.extract-version.outputs.version }}
122139
body: |
@@ -152,8 +169,6 @@ jobs:
152169
dist/*.tar.gz
153170
draft: false
154171
prerelease: false
155-
env:
156-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157172

158173
- name: Summary
159174
run: |

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
# Ensure /etc/os-release exists (required by some actions' OS detection).
6969
apt-get install -y base-files
7070
apt-get install -y build-essential pkg-config libbz2-dev
71-
apt-get install -y -t sid libmapnik-dev fonts-noto-cjk
71+
apt-get install -y -t sid libmapnik-dev
7272
7373
- name: Install uv
7474
uses: astral-sh/setup-uv@v7

pyproject.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ test-extras = ["test"]
5757
# Linux build configuration
5858
[tool.cibuildwheel.linux]
5959
# Use manylinux_2_28 (Debian 12 / Bookworm based)
60-
manylinux-x86_64-image = "manylinux_2_28_x86_64"
61-
manylinux-aarch64-image = "manylinux_2_28_aarch64"
60+
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
61+
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"
6262

6363
# Install system dependencies before build
6464
before-all = """
@@ -78,13 +78,23 @@ before-all = """
7878
archs = ["x86_64", "arm64"]
7979

8080
# Install dependencies via Homebrew (run once before all builds)
81-
before-all = "brew install mapnik icu4c pkg-config boost gdal proj harfbuzz"
81+
before-all = "brew install mapnik icu4c pkg-config boost gdal proj harfbuzz libx11 xorgproto libxext libxrender libxau libxdmcp"
8282

8383
# Set environment variables for each build
8484
# These are exported in the build environment
8585
before-build = """
8686
eval $(brew shellenv)
87-
export PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig:$(brew --prefix)/opt/icu4c/lib/pkgconfig:$(brew --prefix)/opt/boost/lib/pkgconfig:$(brew --prefix)/opt/gdal/lib/pkgconfig:$(brew --prefix)/opt/proj/lib/pkgconfig:$(brew --prefix)/opt/harfbuzz/lib/pkgconfig:$PKG_CONFIG_PATH
88-
export CXXFLAGS="-I$(brew --prefix)/opt/boost/include -I$(brew --prefix)/opt/gdal/include -I$(brew --prefix)/opt/proj/include -I$(brew --prefix)/opt/harfbuzz/include $CXXFLAGS"
89-
export LDFLAGS="-L$(brew --prefix)/opt/boost/lib -L$(brew --prefix)/opt/gdal/lib -L$(brew --prefix)/opt/proj/lib -L$(brew --prefix)/opt/harfbuzz/lib $LDFLAGS"
87+
HOMEBREW_PREFIX=$(brew --prefix)
88+
ICU4C_PREFIX=$(brew --prefix icu4c)
89+
BOOST_PREFIX=$(brew --prefix boost)
90+
GDAL_PREFIX=$(brew --prefix gdal)
91+
PROJ_PREFIX=$(brew --prefix proj)
92+
HARFBUZZ_PREFIX=$(brew --prefix harfbuzz)
93+
XORGPROTO_PREFIX=$(brew --prefix xorgproto)
94+
# Find xorgproto pkg-config directory (may be versioned in Cellar)
95+
XORGPROTO_PKGCONFIG_DIR=$(find "$HOMEBREW_PREFIX/Cellar/xorgproto" -type d -name "pkgconfig" 2>/dev/null | head -1)
96+
[ -z "$XORGPROTO_PKGCONFIG_DIR" ] && XORGPROTO_PKGCONFIG_DIR="$XORGPROTO_PREFIX/share/pkgconfig"
97+
export PKG_CONFIG_PATH="$HOMEBREW_PREFIX/lib/pkgconfig:$HOMEBREW_PREFIX/share/pkgconfig:$ICU4C_PREFIX/lib/pkgconfig:$GDAL_PREFIX/lib/pkgconfig:$PROJ_PREFIX/lib/pkgconfig:$HARFBUZZ_PREFIX/lib/pkgconfig:$XORGPROTO_PKGCONFIG_DIR:$XORGPROTO_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
98+
export CXXFLAGS="-I$BOOST_PREFIX/include -I$GDAL_PREFIX/include -I$PROJ_PREFIX/include -I$HARFBUZZ_PREFIX/include $CXXFLAGS"
99+
export LDFLAGS="-L$BOOST_PREFIX/lib -L$GDAL_PREFIX/lib -L$PROJ_PREFIX/lib -L$HARFBUZZ_PREFIX/lib $LDFLAGS"
90100
"""

0 commit comments

Comments
 (0)