Skip to content

Commit 56165de

Browse files
committed
Enhance macOS DMG workflow by ensuring the presence of a bin/python3 in the vendored Python framework and adding a fallback mechanism to use the embedded app binary if necessary.
1 parent 7879df3 commit 56165de

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/macos-dmg.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ jobs:
148148
# 3) Vendor Python.framework
149149
BREW_PREFIX="$(brew --prefix)"
150150
rsync -a "$BREW_PREFIX/Frameworks/Python.framework" "$FRAMEWORKS/"
151+
# Ensure a bin/python3 exists inside the vendored framework (Homebrew's may omit it)
152+
if [ ! -x "$FRAMEWORKS/Python.framework/Versions/3.13/bin/python3" ]; then
153+
mkdir -p "$FRAMEWORKS/Python.framework/Versions/3.13/bin"
154+
if [ -x "$FRAMEWORKS/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python" ]; then
155+
ln -sf "../Resources/Python.app/Contents/MacOS/Python" "$FRAMEWORKS/Python.framework/Versions/3.13/bin/python3"
156+
fi
157+
fi
151158
152159
# 4) Vendor GTK & friends (most-used libs)
153160
for p in glib gtk4 libadwaita gtksourceview5 gdk-pixbuf pango cairo harfbuzz fribidi graphite2 libpng jpeg libtiff libepoxy libffi gettext; do
@@ -199,7 +206,14 @@ jobs:
199206
export GTK_DATA_PREFIX="$RES"
200207
201208
# Register GResource then run app
202-
"$PYTHONHOME/bin/python3" - <<'PY'
209+
PYBIN="$PYTHONHOME/bin/python3"
210+
if [ ! -x "$PYBIN" ]; then
211+
# Fallback to framework embedded app binary if bin/python3 is absent
212+
if [ -x "$PYTHONHOME/Resources/Python.app/Contents/MacOS/Python" ]; then
213+
PYBIN="$PYTHONHOME/Resources/Python.app/Contents/MacOS/Python"
214+
fi
215+
fi
216+
"$PYBIN" - <<'PY'
203217
import os, sys
204218
from gi.repository import Gio
205219
res_path = os.path.join(os.path.dirname(__file__), '..', 'Resources', 'ssh-studio-resources.gresource')

0 commit comments

Comments
 (0)