Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
523362f
py3 update for automate-git.py and automate.py
Jan 28, 2024
5a5df95
--disable-syntax-validation option at gclient has been removed from u…
Jan 28, 2024
41e0b97
Add support for Python 3.8 and Upgrade Cython (#594)
gmjosack Feb 14, 2021
92a6c69
update spotify prebuilt cef url
Jan 28, 2024
e8a5dc7
fix
Jan 29, 2024
f49ab60
add support for cef 123 version
May 11, 2024
24abdc3
Fix CefListValue "int index" params (#461).
cztomczak Jan 14, 2020
5309afe
getting partical fix from https://github.com/cztomczak/cefpython/comm…
May 12, 2024
0a6a22d
getting partical fix (part 2) from https://github.com/cztomczak/cefpy…
May 12, 2024
daacb75
undo previous unittest change (partly)
May 12, 2024
748f104
Fix V8ContextHandler.OnContextCreated and OnContextReleased (#484).
cztomczak Jan 17, 2020
cd70070
add python311 support
May 12, 2024
e67aa83
undo previous accidental change to common.py
May 12, 2024
2c8819c
update misc place for py311 support
May 12, 2024
af864f0
better handle MainMessageLoopExternalPump, remove some previouis test…
May 19, 2024
cffcf93
add mainframe validation at javascript_bindings.pyx
May 25, 2024
b7aa32c
undo unexpected change to src/compile_time_constatns.pxi
linesight Feb 10, 2025
ffbfdad
not use obsolete base/cef_ptr_util.h
linesight Feb 10, 2025
b3d38bc
add back cef_mac.h and cef_linux.h
linesight Feb 11, 2025
615af96
address pull request feedback
linesight Feb 11, 2025
52edcd8
restore previous language_level line at cython_setup.py
linesight Feb 11, 2025
720782b
remove obsolete stuff
linesight Feb 11, 2025
44fda11
Merge branch 'master' into cefpython123
linesight Feb 13, 2025
3550c40
delete previously commented code
linesight Feb 15, 2025
c68cb2e
address pull request feedback
linesight Feb 15, 2025
cf1778b
delete previously commented code
linesight Feb 15, 2025
541f136
update osr_test.py to respect current event data type
linesight Feb 15, 2025
c4c0806
delete OnPluginCrashed; add initial implementation of CanSendCookie a…
linesight Feb 16, 2025
8286fb1
add back upstream cef 6312 branch's cef_types_linux.h and cef_types_m…
linesight Feb 17, 2025
099f5a1
remove commented SendProcessMessage from cef_browser.pxd
linesight Feb 17, 2025
eddbce1
one more place to use str type for uniqueFrameId
linesight Feb 17, 2025
db1d3ac
bring back SendFocusEvent in browser.pyx for backward compatibility
linesight Feb 17, 2025
1585ccf
replace ondomread.py example using example.com, as google.com website…
linesight Feb 17, 2025
12ef37c
Merge pull request #669 from linesight/cefpython123
cztomczak Feb 17, 2025
b4b218d
Modernize build toolchain for CEF 123+ and Python 3.10+
linesight Apr 18, 2026
ded18b7
fix x86/x64 mismatch in MSVC compiler initialization on Windows
linesight Apr 18, 2026
1a5c468
CEF 146: fix windowed rendering with Alloy runtime and deferred brows…
linesight Apr 19, 2026
d6d9764
CEF 146: update CEF headers, client handlers, and build tools
linesight Apr 19, 2026
f71c84e
ignore .claude/ directory
linesight Apr 19, 2026
e4b6504
CEF 146: fix unit tests for Chrome 130+ behavioral changes
linesight Apr 19, 2026
5dfad26
fix CEFPYTHON_BINARY_NOTSET when build.py is run without explicit ver…
linesight Apr 19, 2026
cfc952a
CEF 146: fix Initialize() race condition and update unit tests
linesight Apr 19, 2026
d8d32ea
CEF 146: fix GPU crash on Windows by defaulting to ANGLE OpenGL backend
linesight Apr 19, 2026
3b0de46
CEF 146: fix JS bindings race condition and update snippet examples
linesight Apr 20, 2026
48705a2
CEF 146: add crossdomain_bindings.py snippet and update README
linesight Apr 20, 2026
0be4137
CEF 146: fix cookie visitor thread assertion and update snippet URLs
linesight Apr 20, 2026
8477bf7
CEF 146: fix CanSendCookie/CanSaveCookie and cookie API issues
linesight Apr 20, 2026
4db1564
Add Windows CI workflow with timeout guard
linesight Apr 20, 2026
c6f7075
Add Python 3.12/3.13/3.14 support and fix Python 3.12 SyntaxWarnings
linesight Apr 20, 2026
1f7f3d0
Upgrade Cython 0.29.36 to 3.2.4 for Python 3.13 compatibility
linesight Apr 20, 2026
6b9c835
Fix Cython 3.x deprecation warnings and performance hints
linesight Apr 20, 2026
9e5d3e4
Add workflow_dispatch with bypass_cache option to CI
linesight Apr 20, 2026
7191270
Fix first-pass C++ build error for Python 3.14 (and all versions)
linesight Apr 20, 2026
080f567
Migrate build system to scikit-build-core + CMake
linesight Apr 20, 2026
7dda5b1
Track cefpython3/__init__.py; gitignore build outputs in cefpython3/
linesight Apr 20, 2026
161a22a
Fix missing docopt in CI test job
linesight Apr 20, 2026
ca2374c
Move 'Install build tools' before automate.py in all CI jobs
linesight Apr 20, 2026
a547642
Fix cefpython3 not importable during unit tests
linesight Apr 20, 2026
3fd83d4
Eliminate CEF/build-tool overhead from test job
linesight Apr 20, 2026
0757f80
Rewrite build_distrib.py to package pre-built artifacts into a wheel
linesight Apr 20, 2026
55a4e3a
Make .pxi files static; remove cmake_generate_pxi.py
linesight Apr 20, 2026
1c9a6ce
Add Linux CI workflow and make build.py cross-platform
linesight Apr 20, 2026
083c3b2
Fix CEF prebuilt build failing on GCC 13 (Ubuntu 24.04)
linesight Apr 20, 2026
eb7f73f
Fix Linux cmake --build failures: update CEF 146 Linux headers and ad…
linesight Apr 20, 2026
d5df420
Fix CEF 146 API changes in GTK handlers; exclude dpi_aware on Linux
linesight Apr 21, 2026
abdf42a
Guard dpi_aware.cpp with #ifdef OS_WIN instead of CMake exclusion
linesight Apr 21, 2026
724ef3e
Fix Linux-specific compile errors in x11.cpp and print_handler_gtk.cpp
linesight Apr 21, 2026
8be3209
Fix print_handler_gtk.cpp for CEF 146 / GTK 3.24 API changes
linesight Apr 21, 2026
56aa89b
Fix CEF 146 API changes in Linux message loop and print handler
linesight Apr 21, 2026
1c516db
Add GTK3 includes/libs to main module target on Linux
linesight Apr 21, 2026
95d32cb
Fix Linux CI build: C++20 standard, subprocess link, removed APIs
linesight Apr 21, 2026
ccda5ae
Fix dpi_aware.cpp guard: OS_WIN -> _WIN32
linesight Apr 21, 2026
2d118be
Fix X11/CEF 'Status' typedef conflict in x11.h on Linux
linesight Apr 21, 2026
5e68627
Fix Linux CI tests: add --no-sandbox for subprocess launch
linesight Apr 21, 2026
b409173
add windows CI at this branch
linesight Apr 21, 2026
596b998
Add --disable-dev-shm-usage for Linux CI to fix shared memory failure
linesight Apr 21, 2026
28f2bca
Fix Linux CI test failures and improve cache hit speed
linesight Apr 21, 2026
9f40f3b
Fix Linux CI: add --no-zygote to bypass zygote FD-passing failure
linesight Apr 21, 2026
3d3effc
Replace pkg_resources with packaging.version in examples
linesight Apr 21, 2026
ebc151a
Add --in-process-gpu for Linux CI to fix OnContextInitialized timeout
linesight Apr 21, 2026
372af5f
Add macOS ARM (Apple Silicon) CI workflow and build support
linesight Apr 21, 2026
140859a
Fix macOS ARM64 compilation errors in macOS message loop and CMake
linesight Apr 21, 2026
3a7e09d
Retry download on truncated response in download_cef.py
linesight Apr 21, 2026
076f8dc
Fix Linux CefMainArgs empty command line; log subprocess type
linesight Apr 21, 2026
0dff81a
Fix CEF_API_HASH_PLATFORM missing from cef_version_macarm64.h
linesight Apr 21, 2026
6ff8464
Fix CI: resize /dev/shm and disable out-of-process storage service
linesight Apr 21, 2026
9cc7d91
disable windows ci for this branch for now
linesight Apr 21, 2026
bb5fffb
Fix macOS ARM64 compile errors: update stale cef_types_mac.h and cef_…
linesight Apr 21, 2026
4f1fbb9
Revert diagnostic LOG(ERROR) back to LOG(INFO) in OnBeforeChildProces…
linesight Apr 21, 2026
3115614
Add missing cef_application_mac.h to bundled headers
linesight Apr 21, 2026
7dc5078
Fix util_mac.mm: explicit cast void* -> NSView* for ARM64
linesight Apr 21, 2026
a64f75d
Remove -std=gnu++11 from macOS target_compile_options
linesight Apr 21, 2026
e2ef751
Fix window_info.pyx Darwin SetAsChild: use CefRect instead of 5-arg form
linesight Apr 21, 2026
c1f6259
Update cef_mac.pxd: fix SetAsChild signature, add runtime_style/enum
linesight Apr 21, 2026
d0e7e31
Extend OnContextInitialized wait from 6s to 30s; add fallback in Crea…
linesight Apr 21, 2026
dfa9e40
Add --single-process for Linux CI to fix renderer Mojo bootstrap failure
linesight Apr 21, 2026
bf843f4
Fix macOS ARM CI: bust stale x86_64 CEF cache, add arch check
linesight Apr 21, 2026
36a45c1
Pass all switches in argv to CefMainArgs on Linux
linesight Apr 21, 2026
80b8215
Fix macOS ARM CI: build libcef_dll_wrapper for native arch
linesight Apr 21, 2026
8c9b1b2
Fix macOS subprocess: add rpath so dyld can find CEF framework
linesight Apr 21, 2026
89f54a0
Re-add utility service in-process flags for Linux CI
linesight Apr 21, 2026
72a16c0
Fix macOS CI tests: add no-sandbox and in-process-gpu switches
linesight Apr 21, 2026
4451b83
Fix macOS ARM OSR: exclude disable-surfaces/begin-frame switches, ext…
linesight Apr 21, 2026
1da62d7
Use async CreateBrowser() + pump loop on Linux to avoid CreateBrowser…
linesight Apr 21, 2026
cc0217e
Fix macOS CI: use --single-process to bypass Mach port rendezvous fai…
linesight Apr 21, 2026
fb56b04
Use --disable-setuid-sandbox instead of --no-sandbox on Linux CI
linesight Apr 21, 2026
b643615
Fix macOS CI: run tests in user login session for Mach port rendezvous
linesight Apr 21, 2026
bc1cfad
Fix Linux subprocess crash: don't set no_sandbox=1 on Linux
linesight Apr 23, 2026
5029683
Add Linux CEF 146 native-windowed embedding support
linesight Apr 26, 2026
774d6f1
Fix Linux unit test: close JS popup without GLib event dispatch
linesight Apr 27, 2026
d9ab1f4
build_distrib: fix Linux/macOS support
linesight Apr 27, 2026
c00da18
Fix flaky OSR test: wait for OnAccessibilityLocationChange on slow CI
linesight Apr 27, 2026
fbb2a7d
osr_test: extend accessibility location-change grace period to 3 s
linesight Apr 27, 2026
1a17b7f
Merge branch 146-linux into 146-macos
linesight Apr 27, 2026
370784d
Fix macOS CI V8 OOM: remove --single-process now that launchctl asuse…
linesight Apr 27, 2026
378263a
Fix macOS CI: run network service in-process to avoid Mach port rende…
linesight Apr 27, 2026
ae0d5cf
gitignore: add Linux build artifacts for cefpython3/
linesight Apr 27, 2026
9597b25
cookie: sync CefCookie struct and thread assertion with CEF 146
linesight Apr 28, 2026
97dd328
linux: fix heap corruption in _wait_for_map XWindowAttributes buffer
linesight Apr 28, 2026
4ce9951
osr_test: fix flaky OnAccessibilityLocationChange on Linux CI
linesight Apr 28, 2026
2cd08f4
osr_test: drop OnAccessibilityLocationChange assert
linesight Apr 28, 2026
2fd1f85
api, docs: sync with source and drop Python 2 / pre-3.10 support
linesight Apr 28, 2026
46ad61a
wxpython, x11: fix browser not resizing on Linux window resize
linesight Apr 28, 2026
509f2ac
qt: context menu + PyQt6/PySide6 Linux embedding fixes
linesight Apr 29, 2026
54d7443
linux: fix window-close hang, popup lifecycle, PDF frame crash
linesight Apr 29, 2026
00ee500
Merge branch '146-linux' into 146-macos
linesight Apr 29, 2026
c983050
macos: fix Mach rendezvous crash by dropping sudo launchctl asuser
linesight Apr 29, 2026
30b4a71
macos: fix CI tests, build.py runtime/codesign, and gitignore
linesight Apr 29, 2026
c3d48ef
macos: fix Mach rendezvous by injecting CFBundleIdentifier + CFProces…
linesight Apr 29, 2026
8290b0a
macos/linux: fix NetworkServiceInProcess feature name (was "2"-less v…
linesight Apr 29, 2026
eadf73a
macos: ad-hoc codesign subprocess and .so to fix MachPortRendezvous f…
linesight Apr 29, 2026
e69f40a
macos: inject CFBundleIdentifier in subprocess before MachPortRendezv…
linesight Apr 29, 2026
2b5d253
macos: fix extern C SubprocessMacInit declaration scope
linesight Apr 29, 2026
3dc5afe
macos: link subprocess against CoreFoundation
linesight Apr 29, 2026
2c0a356
macos: embed Info.plist in subprocess binary via -sectcreate
linesight Apr 29, 2026
1fcc5ce
macos: codesign Python interpreter to fix bootstrap namespace restric…
linesight Apr 29, 2026
f10daa6
macos: replace removed --in-process-renderer with --single-process
linesight Apr 30, 2026
7a5762d
macos: add --jitless to fix V8 CodeRange OOM in --single-process mode
linesight Apr 30, 2026
51b7e69
macos: minimize diff vs 146-linux in build.py and unit test files
linesight Apr 30, 2026
d73710d
macos: fix CRLF line endings in .gitignore
linesight Apr 30, 2026
fddf226
macos: drop Intel Mac support, arm64 only
linesight Apr 30, 2026
b33250e
macos: fix GPU crash, drop redundant switches, codesign wheel binaries
linesight Apr 30, 2026
20c74d0
download_cef: add HTTP Range resume support and increase retries
linesight May 3, 2026
9e3bce1
build_distrib: preserve executable permissions in wheel zip entries
linesight May 3, 2026
737a54e
build: suppress false-positive -Wstringop-overflow warnings with GCC …
linesight May 3, 2026
39b31cc
ci: ensure subprocess is executable in wheel job
linesight May 3, 2026
883fc39
ci: flatten wheel pipeline and deduplicate CEF download
linesight May 3, 2026
586bd0d
build: extend -Wno-stringop-overflow to LTO link step
linesight May 3, 2026
1d8b6b1
build: update CEF to 147.0.10 and configure CI for cefpython147 branch
linesight May 3, 2026
9159645
fix: force xcb on Linux and warn on handle=0 in Wayland sessions
linesight May 3, 2026
187b54b
fix: Wayland xcb forcing, HiDPI scaling, and handle=0 diagnostic for …
linesight May 3, 2026
9f1c583
docs: use upstream wording in README search instructions
linesight May 3, 2026
0505593
ci: add download-cef job to macOS workflow so CEF is downloaded once
linesight May 3, 2026
31470b6
ci: add download-cef job to macOS workflow so CEF is downloaded once
linesight May 3, 2026
17911e6
cleanup: remove dead legacy build.py fallback from cefpython_public_a…
linesight May 3, 2026
4009654
examples: replace packaging.version with stdlib tuple comparison
linesight May 3, 2026
d8b9354
Merge cefpython147 into cefpython147-qt (2026-05-03)
linesight May 3, 2026
19a0863
fix: guard against NULL CefBrowser during rapid frame lifecycle trans…
linesight May 4, 2026
133cbb3
fix: make OnTextSelectionChanged click target robust against CI layou…
linesight May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
143 changes: 143 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: CI Linux

on:
push:
branches: ["master", "cefpython147"]
pull_request:
branches: ["master"]
workflow_dispatch:
inputs:
bypass_cache:
description: "Bypass all caches for a clean run"
type: boolean
default: false

jobs:
download-cef:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Read CEF version
id: cef-version
run: |
ver=$(grep -oP '(?<=#define CEF_VERSION ")[^"]+' src/version/cef_version_linux.h)
echo "value=$ver" >> $GITHUB_OUTPUT

- name: Cache CEF binaries
uses: actions/cache@v4
if: ${{ inputs.bypass_cache != true }}
with:
path: |
build/cef_binary_*
build/cef*_linux64
key: cef-linux64-${{ steps.cef-version.outputs.value }}

- name: Install build tools
run: python tools/requirements.py

- name: Download CEF binaries
run: python tools/download_cef.py

wheel:
needs: download-cef
runs-on: ubuntu-24.04
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Read CEF version
id: cef-version
run: |
ver=$(grep -oP '(?<=#define CEF_VERSION ")[^"]+' src/version/cef_version_linux.h)
echo "value=$ver" >> $GITHUB_OUTPUT

- name: Restore CEF cache
uses: actions/cache/restore@v4
if: ${{ inputs.bypass_cache != true }}
with:
path: |
build/cef_binary_*
build/cef*_linux64
key: cef-linux64-${{ steps.cef-version.outputs.value }}

- name: Install system dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends \
cmake ninja-build pkg-config \
libgtk2.0-dev libgtk-3-dev \
libglib2.0-dev libx11-dev \
libnss3-dev libatk1.0-dev \
libxcomposite-dev libxdamage-dev libxext-dev \
libxfixes-dev libxrandr-dev libxrender-dev

- name: Install build tools
run: python tools/requirements.py

- name: Prepare prebuilt CEF
run: python tools/automate.py --prebuilt-cef

- name: Configure CMake
run: cmake -S . -B build/_cmake_build -G Ninja -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build/_cmake_build --parallel

- name: Stage build outputs
run: |
mkdir -p build/artifacts
cp build/_cmake_build/cefpython_py*.so build/artifacts/
cp build/_cmake_build/subprocess_build/subprocess build/artifacts/
cef_dir=$(ls -d build/cef*_linux64 2>/dev/null | head -1)
find "$cef_dir/bin" -maxdepth 1 -mindepth 1 \
! -name 'cefclient*' ! -name 'cefsimple*' ! -name 'ceftests*' ! -name 'chrome-sandbox' \
-exec cp -r {} build/artifacts/ \;

- name: Install runtime dependencies
run: |
sudo apt-get install -y --no-install-recommends \
libnss3 libatk1.0-0 libatk-bridge2.0-0 \
libx11-6 libxcomposite1 libxdamage1 libxext6 \
libxfixes3 libxrandr2 libxrender1 \
libgtk2.0-0 libglib2.0-0 xvfb

- name: Set up cefpython3 package
run: |
cp -r build/artifacts/. cefpython3/
chmod +x cefpython3/subprocess

- name: Resize /dev/shm for Chromium shared memory
run: sudo mount -o remount,size=512m /dev/shm

- name: Run unit tests
run: xvfb-run python unittests/_test_runner.py
env:
PYTHONPATH: ${{ github.workspace }}

- name: Build wheel
run: python tools/build_distrib.py

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: cefpython3-py${{ matrix.python-version }}-linux64
path: build/dist/*.whl
237 changes: 237 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
name: CI macOS ARM

on:
push:
branches: ["master", "cefpython147"]
pull_request:
branches: ["master"]
workflow_dispatch:
inputs:
bypass_cache:
description: "Bypass all caches for a clean run"
type: boolean
default: false

jobs:
download-cef:
runs-on: macos-14
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Read CEF version
id: cef-version
run: |
ver=$(python3 -c "
import re, sys
h = open('src/version/cef_version_macarm64.h').read()
m = re.search(r'#define CEF_VERSION \"([^\"]+)\"', h)
print(m.group(1))
")
echo "value=$ver" >> $GITHUB_OUTPUT

- name: Cache CEF binaries
uses: actions/cache@v4
if: ${{ inputs.bypass_cache != true }}
with:
path: |
build/cef_binary_*
build/cef*_macarm64
key: cef-macosarm64-v3-${{ steps.cef-version.outputs.value }}

- name: Install build tools
run: python tools/requirements.py

- name: Download CEF binaries
run: python tools/download_cef.py

compile:
needs: download-cef
runs-on: macos-14
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Read CEF version
id: cef-version
run: |
ver=$(python3 -c "
import re, sys
h = open('src/version/cef_version_macarm64.h').read()
m = re.search(r'#define CEF_VERSION \"([^\"]+)\"', h)
print(m.group(1))
")
echo "value=$ver" >> $GITHUB_OUTPUT

- name: Restore CEF cache
uses: actions/cache/restore@v4
if: ${{ inputs.bypass_cache != true }}
with:
path: |
build/cef_binary_*
build/cef*_macarm64
key: cef-macosarm64-v3-${{ steps.cef-version.outputs.value }}

- name: Install build tools
run: python tools/requirements.py

- name: Prepare prebuilt CEF
run: python tools/automate.py --prebuilt-cef

- name: Verify CEF architecture
run: |
wrapper=$(ls build/cef*_macarm64/lib/libcef_dll_wrapper.a 2>/dev/null | head -1)
if [ -z "$wrapper" ]; then echo "libcef_dll_wrapper.a not found"; exit 1; fi
archs=$(lipo -info "$wrapper" 2>&1)
echo "$archs"
echo "$archs" | grep -q arm64 || { echo "ERROR: libcef_dll_wrapper.a is not arm64"; exit 1; }

- name: Configure CMake
run: cmake -S . -B build/_cmake_build -G Ninja -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build/_cmake_build --parallel

- name: Stage build outputs
run: |
mkdir -p build/artifacts
cp build/_cmake_build/cefpython_py*.so build/artifacts/
cp build/_cmake_build/subprocess_build/subprocess build/artifacts/
cef_dir=$(ls -d build/cef*_macarm64 2>/dev/null | head -1)
find "$cef_dir/bin" -maxdepth 1 -mindepth 1 \
! -name 'cefclient*' ! -name 'cefsimple*' ! -name 'ceftests*' \
-exec cp -r {} build/artifacts/ \;

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-py${{ matrix.python-version }}-macosarm64
path: build/artifacts/
retention-days: 1

test:
needs: compile
runs-on: macos-14
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-py${{ matrix.python-version }}-macosarm64
path: build/artifacts/

- name: Set up cefpython3 package for testing
run: |
cp -r build/artifacts/. cefpython3/
chmod +x cefpython3/subprocess
# Ad-hoc sign our compiled binaries so macOS allows them to run.
# (Our freshly built binaries have no signature; unsigned binaries
# are blocked on macOS 14+.)
codesign --force --sign - cefpython3/subprocess
for f in cefpython3/cefpython_py*.so; do codesign --force --sign - "$f"; done

- name: Run unit tests
run: |
# Create a minimal app bundle so Python has a CFBundleIdentifier.
# CEF 130+ forms the MachPortRendezvousServer bootstrap service name
# as BaseBundleID()+".MachPortRendezvousServer."+pid. Without a
# bundle ID the name starts with "." which bootstrap_register rejects,
# causing renderer subprocesses to crash. Setting CFProcessPath
# before Python starts makes CFBundleGetMainBundle() return this
# bundle, giving BaseBundleID() a valid value before CefInitialize().
BUNDLE_DIR="${{ github.workspace }}/CEFPython.app"
mkdir -p "$BUNDLE_DIR/Contents/MacOS"
ln -sf "$(which python)" "$BUNDLE_DIR/Contents/MacOS/python"
cat > "$BUNDLE_DIR/Contents/Info.plist" << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>org.cefpython</string>
<key>CFBundleName</key>
<string>CEFPython</string>
<key>CFBundleExecutable</key>
<string>python</string>
</dict>
</plist>
PLIST
PYTHONPATH="${{ github.workspace }}" \
CFProcessPath="$BUNDLE_DIR/Contents/MacOS/python" \
python unittests/_test_runner.py

wheel:
needs: test
runs-on: macos-14
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-py${{ matrix.python-version }}-macosarm64
path: build/artifacts/

- name: Set up cefpython3 package
run: cp -r build/artifacts/. cefpython3/

- name: Codesign binaries for distribution
run: |
# Ad-hoc sign the subprocess binary so macOS 14+ Gatekeeper allows
# it to execute when users install the wheel. Without signing,
# macOS blocks the unsigned binary and the GPU process (which uses
# the same binary with --type=gpu-process) exits with code 1003
# (GPU_DEAD_ON_ARRIVAL), causing a fatal crash.
codesign --force --sign - cefpython3/subprocess
for f in cefpython3/cefpython_py*.so; do codesign --force --sign - "$f"; done

- name: Build wheel
run: python tools/build_distrib.py

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: cefpython3-py${{ matrix.python-version }}-macosarm64
path: build/dist/*.whl
Loading