diff --git a/.github/workflows/build-app-offline.yml b/.github/workflows/build-app-offline.yml new file mode 100644 index 000000000..f5e22b465 --- /dev/null +++ b/.github/workflows/build-app-offline.yml @@ -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 diff --git a/.gitignore b/.gitignore index b4d483c42..c2d213861 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .DS_Store OCLP-GUI.command /payloads/Apple -/payloads/Apple.zip +/payloads/*.zip /payloads/__MACOSX /App /Build-Folder diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ed8f8b98..0f4a6d25f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ - System Preferences will not report settings however - Allow Root Volume Patched Systems to use FileVault 2 - Requires macOS 11.3 (20E232) or newer +- Add offline TUI build + - Allows for root patching without network connection ## 0.2.4 diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index ebc239826..75f426ed3 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -540,7 +540,13 @@ set million colour before rebooting""" print("- Removing old Apple Binaries zip") Path(self.constants.payload_apple_root_path_zip).unlink() - Utilities.download_file(link, self.constants.payload_apple_root_path_zip) + 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) if self.constants.payload_apple_root_path_zip.exists(): print("- Download completed") diff --git a/create-offline-build.py b/create-offline-build.py new file mode 100644 index 000000000..b22cb8335 --- /dev/null +++ b/create-offline-build.py @@ -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")