diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 52e92998e..3c83632e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 15721be1b..0de49110d 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -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() diff --git a/OpenCore-Patcher.spec b/OpenCore-Patcher.spec index d8b05a419..c0c45d516 100644 --- a/OpenCore-Patcher.spec +++ b/OpenCore-Patcher.spec @@ -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" + }) diff --git a/after_pyinstaller.sh b/after_pyinstaller.sh new file mode 100755 index 000000000..306e08f43 --- /dev/null +++ b/after_pyinstaller.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cp launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher \ No newline at end of file diff --git a/launcher.sh b/launcher.sh new file mode 100755 index 000000000..57152644b --- /dev/null +++ b/launcher.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd "$(dirname "$0")" + +chmod +x OpenCore-Patcher +open OpenCore-Patcher \ No newline at end of file