@@ -29,157 +29,70 @@ jobs:
2929 echo "version=${VERSION}" >> $GITHUB_OUTPUT
3030 echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT
3131
32- linux- build :
32+ build-wheels :
3333 needs : [extract-version]
3434 strategy :
3535 fail-fast : false
3636 matrix :
37- include :
38- - os : ubuntu-latest
39- container : python:3.12-bookworm
40- platform : linux_x86_64
41- arch : x86_64
42- arch_label : x86_64
43- - os : ubuntu-24.04-arm
44- container : python:3.12-bookworm
45- platform : linux_aarch64
46- arch : arm64
47- arch_label : arm64
37+ os : [ubuntu-latest, macos-latest, macos-15-intel]
4838 runs-on : ${{ matrix.os }}
49- container : ${{ matrix.container }}
50- env :
51- UV_LINK_MODE : copy
52- UV_CACHE_DIR : /github/home/.cache/uv
5339 permissions :
54- actions : write
5540 contents : write
56-
5741 steps :
5842 - name : Checkout code
5943 uses : actions/checkout@v6
6044 with :
6145 submodules : recursive
6246
63- - name : Cache uv downloads
64- uses : actions/cache@v5
65- with :
66- path : /github/home/.cache/uv
67- key : uvcache-${{ runner.os }}-${{ matrix.arch_label }}-${{ hashFiles('uv.lock', 'pyproject.toml') }}
68- restore-keys : |
69- uvcache-${{ runner.os }}-${{ matrix.arch_label }}-
70-
71- - name : Add Debian sid repository
72- if : matrix.container != null
47+ - name : Install cibuildwheel
7348 run : |
74- echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list.d/sid.list
75- echo 'Package: *\nPin: release a=sid\nPin-Priority: 100' > /etc/apt/preferences.d/sid
49+ python -m pip install --upgrade pip
50+ pip install cibuildwheel
7651
77- - name : Install system dependencies (Linux)
78- if : matrix.container != null
52+ - name : Build wheels
53+ env :
54+ CIBW_BUILD_VERBOSITY : 1
55+ CIBW_BEFORE_BUILD : " pip install uv && uv sync --frozen --no-dev || uv sync --no-dev"
7956 run : |
80- apt-get update
81- apt-get install -y base-files
82- apt-get install -y build-essential pkg-config libbz2-dev
83- apt-get install -y -t sid libmapnik-dev
57+ cibuildwheel --output-dir wheelhouse
8458
85- - name : Install uv
86- uses : astral-sh/setup-uv@v7
59+ - name : Upload wheels
60+ uses : actions/upload-artifact@v4
8761 with :
88- enable-cache : false
62+ name : wheels-${{ matrix.os }}
63+ path : wheelhouse/*.whl
64+ retention-days : 7
8965
90- - name : Update version from tag
91- run : |
92- # Extract base version from pyproject.toml
93- BASE_VERSION=$(grep -E '^version = ' pyproject.toml | sed -E 's/^version = "([^"]+)"/\1/')
94- TAG=${{ needs.extract-version.outputs.version }}
95- VERSION="${BASE_VERSION}-${TAG}"
96- echo "Base version from pyproject.toml: $BASE_VERSION"
97- echo "Git tag: $TAG"
98- echo "Setting version to: $VERSION"
99- # Update pyproject.toml
100- sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
101- # Update setup.py
102- sed -i "s/version=\"[^\"]*\"/version=\"$VERSION\"/" setup.py
103- # Verify changes
104- echo "pyproject.toml version:"
105- grep "^version = " pyproject.toml
106- echo "setup.py version:"
107- grep "version=" setup.py | head -1
66+ build-sdist :
67+ needs : [extract-version]
68+ runs-on : ubuntu-latest
69+ permissions :
70+ contents : write
71+ steps :
72+ - name : Checkout code
73+ uses : actions/checkout@v6
74+ with :
75+ submodules : recursive
10876
109- - name : Build wheel and sdist
77+ - name : Install uv
78+ uses : astral-sh/setup-uv@v7
79+
80+ - name : Build sdist
11081 run : |
111- uv build --wheel -- sdist
82+ uv build --sdist
11283
113- - name : Upload build artifacts
84+ - name : Upload sdist
11485 uses : actions/upload-artifact@v4
11586 with :
116- name : dist-${{ matrix.platform }}
117- path : dist/
87+ name : sdist
88+ path : dist/*.tar.gz
11889 retention-days : 7
11990
120- # macos-build:
121- # needs: [extract-version]
122- # strategy:
123- # fail-fast: false
124- # matrix:
125- # include:
126- # - os: macos-15-intel
127- # platform: macosx_10_9_x86_64
128- # arch: x86_64
129- # arch_label: x86_64
130- # - os: macos-15
131- # platform: macosx_15_0_arm64
132- # arch: arm64
133- # arch_label: arm64
134- # runs-on: ${{ matrix.os }}
135- # env:
136- # UV_LINK_MODE: copy
137- # UV_CACHE_DIR: /Users/runner/.cache/uv
138- # permissions:
139- # actions: write
140- # contents: write
141-
142- # steps:
143- # - name: Checkout code
144- # uses: actions/checkout@v6
145- # with:
146- # submodules: recursive
147-
148- # - name: Cache uv downloads
149- # uses: actions/cache@v5
150- # with:
151- # path: /Users/runner/.cache/uv
152- # key: uvcache-${{ runner.os }}-${{ matrix.arch_label }}-${{ hashFiles('uv.lock', 'pyproject.toml') }}
153- # restore-keys: |
154- # uvcache-${{ runner.os }}-${{ matrix.arch_label }}-
155-
156- # - name: Install and cache Homebrew tools
157- # uses: tecolicom/actions-use-homebrew-tools@v1
158- # with:
159- # tools: mapnik icu4c pkg-config
160- # key: mapnik-${{ matrix.arch_label }}
161-
162- # - name: Install uv
163- # uses: astral-sh/setup-uv@v7
164- # with:
165- # enable-cache: false
166-
167- # - name: Build wheel and sdist
168- # run: |
169- # uv build --wheel --sdist
170-
171- # - name: Upload build artifacts
172- # uses: actions/upload-artifact@v4
173- # with:
174- # name: dist-${{ matrix.platform }}
175- # path: dist/
176- # retention-days: 7
177-
17891 release :
17992 needs :
18093 - extract-version
181- - linux- build
182- # - macos- build
94+ - build-wheels
95+ - build-sdist
18396 runs-on : ubuntu-latest
18497 permissions :
18598 contents : write
@@ -194,8 +107,12 @@ jobs:
194107 - name : Combine artifacts
195108 run : |
196109 mkdir -p dist
110+ # Copy all wheels
197111 find dist-all -name "*.whl" -exec cp {} dist/ \;
198- find dist-all -name "*.tar.gz" -exec head -1 {} \; | head -1 | xargs -I {} find dist-all -name "{}" -exec cp {} dist/ \;
112+ # Copy sdist (should be only one)
113+ find dist-all -name "*.tar.gz" -exec cp {} dist/ \;
114+ echo "Artifacts in dist/:"
115+ ls -lh dist/
199116
200117 - name : Create GitHub Release
201118 uses : softprops/action-gh-release@v2
@@ -250,8 +167,8 @@ jobs:
250167 echo "### Supported Platforms:" >> $GITHUB_STEP_SUMMARY
251168 echo "- Linux x86_64: ✅" >> $GITHUB_STEP_SUMMARY
252169 echo "- Linux arm64: ✅" >> $GITHUB_STEP_SUMMARY
253- # echo "- macOS x86_64: ✅" >> $GITHUB_STEP_SUMMARY
254- # echo "- macOS arm64: ✅" >> $GITHUB_STEP_SUMMARY
170+ echo "- macOS x86_64: ✅" >> $GITHUB_STEP_SUMMARY
171+ echo "- macOS arm64: ✅" >> $GITHUB_STEP_SUMMARY
255172 echo "" >> $GITHUB_STEP_SUMMARY
256173 echo "### Distribution:" >> $GITHUB_STEP_SUMMARY
257174 echo "- GitHub Release: ✅" >> $GITHUB_STEP_SUMMARY
0 commit comments