Skip to content

Commit c2b134d

Browse files
authored
feat: Make macOS wheel mac-universal (#146)
* feat: wheel for mac is universal wheel now * chore: Clean up * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Universal pipeline * fix: Run universal mac wheel build also on mac Intel * fix: Proper build check * fix: Bump version number * fix: Push to test PYPI * fix: Prepare to publish to PyPI
1 parent 3deeef2 commit c2b134d

File tree

4 files changed

+36
-109
lines changed

4 files changed

+36
-109
lines changed

.github/workflows/build-wheel.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
rm -f /io/dist/*-linux_*.whl
7474
"
7575
76+
# Install twine to verify wheels
77+
pip install twine
78+
7679
# Verify the wheel was built
7780
echo "Contents of dist directory:"
7881
ls -la dist/
@@ -81,6 +84,10 @@ jobs:
8184
echo "Wheel filenames:"
8285
find dist -name "*.whl" -exec basename {} \;
8386
87+
# Verify wheel structure
88+
echo "Verifying wheels using twine check"
89+
twine check dist/*
90+
8491
- name: Build Windows wheel (x64)
8592
if: runner.os == 'Windows'
8693
shell: pwsh
@@ -95,6 +102,7 @@ jobs:
95102
pip install -r requirements.txt
96103
pip install -r requirements-dev.txt
97104
pip install wheel
105+
pip install twine
98106
99107
# Download native artifacts
100108
Write-Host "Starting artifact download process..."
@@ -110,8 +118,11 @@ jobs:
110118
# Build wheel
111119
python setup.py bdist_wheel --plat-name win_amd64
112120
113-
- name: Build macOS wheel (Apple Silicon)
114-
if: runner.os == 'macOS' && runner.arch == 'arm64'
121+
# Verify wheel structure
122+
twine check dist/*
123+
124+
- name: Build macOS wheel (Universal)
125+
if: runner.os == 'macOS'
115126
run: |
116127
# Create necessary directories
117128
mkdir -p artifacts
@@ -122,20 +133,25 @@ jobs:
122133
pip install -r requirements.txt
123134
pip install -r requirements-dev.txt
124135
pip install wheel
136+
pip install twine
125137
126138
# Download native artifacts
127139
python scripts/download_artifacts.py $C2PA_VERSION
128140
129141
# Build wheel
130-
python setup.py bdist_wheel --plat-name macosx_11_0_arm64
142+
python setup.py bdist_wheel --plat-name macosx_10_9_universal2
131143
132144
# Rename wheel to ensure unique filename
133145
cd dist
134146
for wheel in *.whl; do
135-
mv "$wheel" "${wheel/macosx_11_0_arm64/macosx_11_0_arm64}"
147+
mv "$wheel" "${wheel/macosx_10_9_universal2/macosx_10_9_universal2}"
136148
done
137149
cd ..
138150
151+
# Verify wheel structure
152+
echo "Verifying wheels using twine check"
153+
twine check dist/*
154+
139155
- name: Log wheel filename
140156
if: runner.os == 'Linux' || runner.os == 'macOS'
141157
shell: bash

.github/workflows/build.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,19 +326,23 @@ jobs:
326326
.\venv\Scripts\pytest .\tests\test_unit_tests.py -v
327327
328328
build-macos-wheel:
329-
name: Build macOS wheel
329+
name: Build macOS wheel (Universal)
330330
uses: ./.github/workflows/build-wheel.yml
331331
needs: [tests-unix, read-version]
332332
with:
333333
python-version: "3.10"
334-
artifact-name: wheels-macos-${{ matrix.target }}
335334
runs-on: macos-latest
335+
artifact-name: wheels-macos-${{ matrix.target }}
336+
architecture: ${{ matrix.target }}
336337
c2pa-version: ${{ needs.read-version.outputs.c2pa-native-version }}
337338
secrets:
338339
github-token: ${{ secrets.GITHUB_TOKEN }}
339340
strategy:
340341
matrix:
341-
target: [aarch64]
342+
include:
343+
- target: universal2
344+
runs-on: macos-latest
345+
342346
if: |
343347
github.event_name != 'pull_request' ||
344348
github.event.pull_request.author_association == 'COLLABORATOR' ||
@@ -347,12 +351,17 @@ jobs:
347351
contains(github.event.pull_request.labels.*.name, 'safe to test')
348352
349353
test-built-macos-wheel:
350-
name: Test macOS built wheel
354+
name: Test macOS built wheel (Universal)
351355
needs: build-macos-wheel
352-
runs-on: macos-latest
356+
runs-on: ${{ matrix.runs-on }}
353357
strategy:
354358
matrix:
355-
target: [aarch64]
359+
include:
360+
- target: universal2
361+
runs-on: macos-latest
362+
- target: universal2
363+
runs-on: macos-13
364+
356365
if: |
357366
github.event_name != 'pull_request' ||
358367
github.event.pull_request.author_association == 'COLLABORATOR' ||

.github/workflows/upload-test.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "c2pa-python"
7-
version = "0.14.0"
7+
version = "0.15.0"
88
requires-python = ">=3.10"
99
description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library"
1010
readme = { file = "README.md", content-type = "text/markdown" }

0 commit comments

Comments
 (0)