Add offline TUI

This commit is contained in:
Mykola Grymalyuk
2021-09-17 13:42:27 -06:00
parent 950f645f02
commit 45332d2cf9
5 changed files with 57 additions and 2 deletions

33
.github/workflows/build-app-offline.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: CI - Build Offline TUI
on:
push:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build Offline TUI
runs-on: x86_64_mojave
steps:
- uses: actions/checkout@v2
- run: python3 create-offline-build.py
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec
- run: ./after_pyinstaller.sh
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
- run: cd dist; zip -r ../OpenCore-Patcher-TUI-Offline.app.zip OpenCore-Patcher.app
- name: Upload App to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher-TUI-Offline.app
path: OpenCore-Patcher-TUI-Offline.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-TUI.app.zip
tag: ${{ github.ref }}
file_glob: true

2
.gitignore vendored
View File

@@ -1,7 +1,7 @@
.DS_Store .DS_Store
OCLP-GUI.command OCLP-GUI.command
/payloads/Apple /payloads/Apple
/payloads/Apple.zip /payloads/*.zip
/payloads/__MACOSX /payloads/__MACOSX
/App /App
/Build-Folder /Build-Folder

View File

@@ -35,6 +35,8 @@
- System Preferences will not report settings however - System Preferences will not report settings however
- Allow Root Volume Patched Systems to use FileVault 2 - Allow Root Volume Patched Systems to use FileVault 2
- Requires macOS 11.3 (20E232) or newer - Requires macOS 11.3 (20E232) or newer
- Add offline TUI build
- Allows for root patching without network connection
## 0.2.4 ## 0.2.4

View File

@@ -540,6 +540,12 @@ set million colour before rebooting"""
print("- Removing old Apple Binaries zip") print("- Removing old Apple Binaries zip")
Path(self.constants.payload_apple_root_path_zip).unlink() Path(self.constants.payload_apple_root_path_zip).unlink()
local_zip = Path(self.constants.payload_path) / f"{os_ver}.zip"
if Path(local_zip).exists():
print(f"- Found local {os_ver} zip, skipping download")
print(f"- Duplicating into Apple.zip")
shutil.copy(local_zip, self.constants.payload_apple_root_path_zip)
else:
Utilities.download_file(link, self.constants.payload_apple_root_path_zip) Utilities.download_file(link, self.constants.payload_apple_root_path_zip)
if self.constants.payload_apple_root_path_zip.exists(): if self.constants.payload_apple_root_path_zip.exists():

14
create-offline-build.py Normal file
View File

@@ -0,0 +1,14 @@
import subprocess
from Resources import Constants
patcher_support_pkg_version = Constants.Constants().patcher_support_pkg_version
binary_packages = ["10.14-Mojave", "10.15-Catalina", "11-Big-Sur", "12-Monterey"]
for binary_package in binary_packages:
print(f"- Downloading {binary_package}...")
download_cmd = f"curl -LO https://github.com/dortania/PatcherSupportPkg/releases/download/{patcher_support_pkg_version}/{binary_package}.zip"
subprocess.run(download_cmd, shell=True)
print("- Moving into payloads")
move_cmd = f"mv {binary_package}.zip ./payloads/"
subprocess.run(move_cmd, shell=True)
print("- Download complete")