Package as .app

This commit is contained in:
Dhinak G
2021-03-02 00:01:06 -05:00
parent 7b0321be65
commit 8271db0d26
5 changed files with 29 additions and 5 deletions

View File

@@ -24,17 +24,26 @@ jobs:
pip3 install pyinstaller
- run: pyinstaller Opencore-Patcher.spec
- run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher
- run: ./after_pyinstaller.sh
- name: Upload to Artifacts
- run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher; zip ../OpenCore-Patcher.app.zip OpenCore-Patcher.app
- name: Upload Binary to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher
path: OpenCore-Patcher.zip
- name: Upload App to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher.app
path: OpenCore-Patcher.app.zip
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: OpenCore-Patcher.zip
file: OpenCore-Patcher.app.zip
tag: ${{ github.ref }}
file_glob: true

View File

@@ -2,7 +2,7 @@
from __future__ import print_function
import subprocess
import subprocess, sys, time
from Resources import build, ModelArray, Constants, utilities
@@ -88,7 +88,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
response = menu.start()
print("Bye")
if getattr(sys, "frozen", False):
subprocess.run("""osascript -e 'tell application "Terminal" to close first window' & exit""", shell=True)
OpenCoreLegacyPatcher().main_menu()

View File

@@ -30,3 +30,10 @@ exe = EXE(pyz,
upx_exclude=[],
runtime_tmpdir=None,
console=True )
app = BUNDLE(exe,
name='OpenCore-Patcher.app',
icon="OC-Patcher.icns",
bundle_identifier=None,
info_plist={
"CFBundleExecutable": "MacOS/Launcher"
})

2
after_pyinstaller.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
cp launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher

5
launcher.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
cd "$(dirname "$0")"
chmod +x OpenCore-Patcher
open OpenCore-Patcher