MacOS support (#225)

This commit is contained in:
Илья
2026-03-18 17:33:38 +03:00
committed by GitHub
parent 473078593a
commit 533420b516
9 changed files with 959 additions and 4 deletions

View File

@@ -75,8 +75,105 @@ jobs:
name: TgWsProxy-win7
path: dist/TgWsProxy-win7.exe
build-macos:
runs-on: macos-latest
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: |
chmod +x packaging/create_icon.sh
packaging/create_icon.sh
- name: Build app with PyInstaller
run: pyinstaller packaging/macos.spec --noconfirm
- name: Upload 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: |
chmod +x packaging/create_icon.sh
packaging/create_icon.sh
- name: Build app with PyInstaller
run: pyinstaller packaging/macos.spec --noconfirm
- name: Upload app bundle
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: |
chmod +x packaging/merge_universal2.sh
packaging/merge_universal2.sh \
"dist/arm64/TG WS Proxy.app" \
"dist/x86_64/TG WS Proxy.app" \
"dist/TG WS Proxy.app"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: TgWsProxy-macOS
path: dist/TgWsProxy.dmg
release:
needs: [build, build-win7]
needs: [build, build-win7, build-macos-universal]
runs-on: ubuntu-latest
if: ${{ github.event.inputs.make_release == 'true' }}
steps:
@@ -92,6 +189,12 @@ jobs:
name: TgWsProxy-win7
path: dist
- name: Download macOS build
uses: actions/download-artifact@v4
with:
name: TgWsProxy-macOS
path: dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
@@ -102,7 +205,8 @@ jobs:
files: |
dist/TgWsProxy.exe
dist/TgWsProxy-win7.exe
dist/TgWsProxy.dmg
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}