Universal2 macos test
This commit is contained in:
parent
55affaf78f
commit
053ec3e00f
|
|
@ -81,90 +81,111 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Install universal2 Python
|
||||||
uses: actions/setup-python@v5
|
run: |
|
||||||
with:
|
set -euo pipefail
|
||||||
python-version: "3.12"
|
curl -LO https://www.python.org/ftp/python/3.12.10/python-3.12.10-macos11.pkg
|
||||||
cache: "pip"
|
sudo installer -pkg python-3.12.10-macos11.pkg -target /
|
||||||
|
echo "/Library/Frameworks/Python.framework/Versions/3.12/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install -r requirements-macos.txt
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
python3.12 -m pip install --upgrade pip setuptools wheel
|
||||||
|
python3.12 -m pip install delocate==0.13.0
|
||||||
|
|
||||||
- name: Install pyinstaller
|
mkdir -p wheelhouse/arm64 wheelhouse/x86_64 wheelhouse/universal2
|
||||||
run: pip install pyinstaller
|
|
||||||
|
python3.12 -m pip download \
|
||||||
|
--only-binary=:all: \
|
||||||
|
--platform macosx_11_0_arm64 \
|
||||||
|
--python-version 3.12 \
|
||||||
|
--implementation cp \
|
||||||
|
-d wheelhouse/arm64 \
|
||||||
|
Pillow==12.1.0 \
|
||||||
|
psutil==7.0.0
|
||||||
|
|
||||||
|
python3.12 -m pip download \
|
||||||
|
--only-binary=:all: \
|
||||||
|
--platform macosx_10_13_x86_64 \
|
||||||
|
--python-version 3.12 \
|
||||||
|
--implementation cp \
|
||||||
|
-d wheelhouse/x86_64 \
|
||||||
|
Pillow==12.1.0
|
||||||
|
|
||||||
|
python3.12 -m pip download \
|
||||||
|
--only-binary=:all: \
|
||||||
|
--platform macosx_10_9_x86_64 \
|
||||||
|
--python-version 3.12 \
|
||||||
|
--implementation cp \
|
||||||
|
-d wheelhouse/x86_64 \
|
||||||
|
psutil==7.0.0
|
||||||
|
|
||||||
|
delocate-merge \
|
||||||
|
wheelhouse/arm64/pillow-12.1.0-*.whl \
|
||||||
|
wheelhouse/x86_64/pillow-12.1.0-*.whl \
|
||||||
|
-w wheelhouse/universal2
|
||||||
|
|
||||||
|
delocate-merge \
|
||||||
|
wheelhouse/arm64/psutil-7.0.0-*.whl \
|
||||||
|
wheelhouse/x86_64/psutil-7.0.0-*.whl \
|
||||||
|
-w wheelhouse/universal2
|
||||||
|
|
||||||
|
python3.12 -m pip install --no-deps wheelhouse/universal2/*.whl
|
||||||
|
python3.12 -m pip install -r requirements-macos.txt
|
||||||
|
python3.12 -m pip install pyinstaller==6.13.0
|
||||||
|
|
||||||
- name: Create macOS icon from ICO
|
- name: Create macOS icon from ICO
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
chmod +x packaging/create_icon.sh
|
chmod +x packaging/create_icon.sh
|
||||||
packaging/create_icon.sh
|
packaging/create_icon.sh
|
||||||
|
|
||||||
- name: Build app with PyInstaller
|
- name: Build app with PyInstaller
|
||||||
run: pyinstaller packaging/macos.spec --noconfirm
|
run: python3.12 -m PyInstaller packaging/macos.spec --noconfirm
|
||||||
|
|
||||||
- name: Upload app bundle
|
- name: Validate universal2 app bundle
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: TgWsProxy-app-arm64
|
|
||||||
path: "dist/TG WS Proxy.app"
|
|
||||||
|
|
||||||
build-macos-intel:
|
|
||||||
runs-on: macos-15-intel
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
cache: "pip"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install -r requirements-macos.txt
|
|
||||||
|
|
||||||
- name: Install pyinstaller
|
|
||||||
run: pip install pyinstaller
|
|
||||||
|
|
||||||
- name: Create macOS icon from ICO
|
|
||||||
run: |
|
run: |
|
||||||
chmod +x packaging/create_icon.sh
|
set -euo pipefail
|
||||||
packaging/create_icon.sh
|
found=0
|
||||||
|
while IFS= read -r -d '' file; do
|
||||||
|
if file "$file" | grep -q "Mach-O"; then
|
||||||
|
found=1
|
||||||
|
archs="$(lipo -archs "$file" 2>/dev/null || true)"
|
||||||
|
case "$archs" in
|
||||||
|
*arm64*x86_64*|*x86_64*arm64*) ;;
|
||||||
|
*)
|
||||||
|
echo "Missing universal2 slices in $file: ${archs:-unknown}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done < <(find "dist/TG WS Proxy.app" -type f -print0)
|
||||||
|
|
||||||
- name: Build app with PyInstaller
|
if [ "$found" -eq 0 ]; then
|
||||||
run: pyinstaller packaging/macos.spec --noconfirm
|
echo "No Mach-O files found in app bundle" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Upload app bundle
|
- name: Create DMG
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: TgWsProxy-app-x86_64
|
|
||||||
path: "dist/TG WS Proxy.app"
|
|
||||||
|
|
||||||
build-macos-universal:
|
|
||||||
needs: [build-macos, build-macos-intel]
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download arm64 app
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: TgWsProxy-app-arm64
|
|
||||||
path: "dist/arm64/TG WS Proxy.app"
|
|
||||||
|
|
||||||
- name: Download x86_64 app
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: TgWsProxy-app-x86_64
|
|
||||||
path: "dist/x86_64/TG WS Proxy.app"
|
|
||||||
|
|
||||||
- name: Merge into universal2 app and create DMG
|
|
||||||
run: |
|
run: |
|
||||||
chmod +x packaging/merge_universal2.sh
|
set -euo pipefail
|
||||||
packaging/merge_universal2.sh \
|
APP_NAME="TG WS Proxy"
|
||||||
"dist/arm64/TG WS Proxy.app" \
|
DMG_TEMP="dist/dmg_temp"
|
||||||
"dist/x86_64/TG WS Proxy.app" \
|
|
||||||
"dist/TG WS Proxy.app"
|
rm -rf "$DMG_TEMP"
|
||||||
|
mkdir -p "$DMG_TEMP"
|
||||||
|
cp -R "dist/${APP_NAME}.app" "$DMG_TEMP/"
|
||||||
|
ln -s /Applications "$DMG_TEMP/Applications"
|
||||||
|
|
||||||
|
hdiutil create \
|
||||||
|
-volname "$APP_NAME" \
|
||||||
|
-srcfolder "$DMG_TEMP" \
|
||||||
|
-ov \
|
||||||
|
-format UDZO \
|
||||||
|
"dist/TgWsProxy.dmg"
|
||||||
|
|
||||||
|
rm -rf "$DMG_TEMP"
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
@ -173,7 +194,7 @@ jobs:
|
||||||
path: dist/TgWsProxy.dmg
|
path: dist/TgWsProxy.dmg
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build, build-win7, build-macos-universal]
|
needs: [build, build-win7, build-macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event.inputs.make_release == 'true' }}
|
if: ${{ github.event.inputs.make_release == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ exe = EXE(
|
||||||
upx=False,
|
upx=False,
|
||||||
console=False,
|
console=False,
|
||||||
argv_emulation=False,
|
argv_emulation=False,
|
||||||
target_arch=None,
|
target_arch='universal2',
|
||||||
codesign_identity=None,
|
codesign_identity=None,
|
||||||
entitlements_file=None,
|
entitlements_file=None,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue