Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/build-legacy-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build Legacy Wheels (macos-13)

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build_legacy_wheels:
name: macos-13
runs-on: macos-13

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Download model weights from release v0.1.1
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euxo pipefail
mkdir -p src/pyfacewipe/models
gh release download v0.1.1 \
-R "${GITHUB_REPOSITORY}" \
-p "synthstrip.1.pt" \
-p "synthstrip.nocsf.1.pt" \
-D src/pyfacewipe/models
ls -lah src/pyfacewipe/models

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
CIBW_SKIP: "pp* *-musllinux_* *-win32"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_BUILD_VERBOSITY: "1"

- name: Verify wheels contain model weights
shell: bash
run: |
set -euxo pipefail
python - <<'PY'
import glob
import sys
import zipfile

whls = glob.glob("wheelhouse/*.whl")
if not whls:
print("No wheels found in wheelhouse/*.whl", file=sys.stderr)
sys.exit(1)

required = {
"pyfacewipe/models/synthstrip.1.pt",
"pyfacewipe/models/synthstrip.nocsf.1.pt",
}

missing_any = False
for whl in whls:
with zipfile.ZipFile(whl) as z:
names = set(z.namelist())
missing = sorted(required - names)
if missing:
missing_any = True
print(f"ERROR: {whl} is missing: {missing}", file=sys.stderr)
else:
print(f"OK: {whl} contains model weights")

sys.exit(1 if missing_any else 0)
PY

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-legacy-macos-13
path: wheelhouse/*.whl
4 changes: 3 additions & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# macos-13 is handled in build-legacy-wheels.yml because its
# GitHub-hosted runners are intermittently unavailable.
os: [ubuntu-latest, windows-latest, macos-14]

steps:
- name: Checkout
Expand Down
Loading