Skip to content

Commit 692f233

Browse files
committed
No features
1 parent 728302a commit 692f233

File tree

662 files changed

+143990
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

662 files changed

+143990
-2
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
extend-ignore = E501, E203
3+
per-file-ignores =
4+
Resources/constants.py:E704

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build wxPython
2+
on:
3+
push:
4+
paths-ignore:
5+
- 'docs/**'
6+
workflow_dispatch:
7+
release:
8+
types: [published]
9+
jobs:
10+
build:
11+
name: Build wxPython
12+
runs-on: macos-15
13+
if: github.repository_owner == 'hackdoc'
14+
permissions:
15+
contents: write
16+
env:
17+
# GitHub Information
18+
branch: ${{ github.ref }}
19+
commiturl: ${{ github.event.head_commit.url }}${{ github.event.release.html_url }}
20+
commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Setup Python 3.11
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
- name: Install Dependencies
29+
run: |
30+
rm -rf Univ*
31+
rm -rf *pay*.dmg
32+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install -r requirements.txt
33+
aria2c -x 16 "https://github.com/pyquick/PatcherSupportPkg/releases/download/push-d0051499682b521a8a6eee339408b8865d6a1269/Universal-Binaries.dmg"
34+
35+
- name: Force Universal2 charset for Python
36+
run: |
37+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip uninstall -y charset_normalizer
38+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip download --platform macosx_10_9_universal2 --only-binary=:all: charset-normalizer
39+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install charset_normalizer-*-macosx_10_9_universal2.whl
40+
41+
- name: Prepare Assets (--prepare-assets)
42+
43+
run: >
44+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 Build-Project.command
45+
--run-as-individual-steps
46+
--prepare-assets
47+
48+
- name: Prepare Application (--prepare-application)
49+
run: >
50+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 Build-Project.command
51+
--git-branch "${{ env.branch }}" --git-commit-url "${{ env.commiturl }}" --git-commit-date "${{ env.commitdate }}"
52+
--reset-pyinstaller-cache
53+
--run-as-individual-steps
54+
--prepare-application
55+
56+
- name: Prepare Package (--prepare-package)
57+
run: >
58+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 Build-Project.command
59+
--prepare-package
60+
- name: Delete previous pre-release
61+
if: github.event_name == 'push'
62+
uses: dev-drprasad/[email protected]
63+
with:
64+
keep_latest: 0
65+
delete_prerelease_only: true
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Create Pre-Release on Push
70+
if: github.event_name == 'push'
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
tag_name: push-${{ github.sha }}
74+
name: 2.5.2 Beta 1
75+
body: ${{ github.event.head_commit.message }}
76+
prerelease: true
77+
files: |
78+
./dist/AutoPkg-Assets.pkg
79+
./dist/OCLP-R.pkg
80+
./dist/OCLP-R-Uninstaller.pkg
81+
82+
- name: Upload AutoPkg Package to Release
83+
if: github.event_name == 'release'
84+
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
85+
with:
86+
repo_token: ${{ secrets.GITHUB_TOKEN }}
87+
file: ./dist/AutoPkg-Assets.pkg
88+
tag: ${{ github.ref }}
89+
file_glob: true
90+
91+
- name: Upload Installation Package to Release
92+
if: github.event_name == 'release'
93+
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
94+
with:
95+
repo_token: ${{ secrets.GITHUB_TOKEN }}
96+
file: ./dist/OCLP-R.pkg
97+
tag: ${{ github.ref }}
98+
file_glob: true
99+
100+
- name: Upload Uninstaller Package to Release
101+
if: github.event_name == 'release'
102+
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
103+
with:
104+
repo_token: ${{ secrets.GITHUB_TOKEN }}
105+
file: ./dist/OCLP-R-Uninstaller.pkg
106+
tag: ${{ github.ref }}
107+
file_glob: true

.github/workflows/validate.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
workflow_dispatch:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
build:
13+
name: Validate
14+
runs-on: macos-15
15+
if: github.repository_owner == 'hackdoc'
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup Python 3.11
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
- name: Validate
23+
run: |
24+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install -r requirements.txt
25+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install packaging
26+
rm -rf Univ*
27+
aria2c -x 16 "https://github.com/pyquick/PatcherSupportPkg/releases/download/push-d0051499682b521a8a6eee339408b8865d6a1269/Universal-Binaries.dmg"
28+
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 OCLP-R-GUI.command --validate
29+

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.DS_Store
2+
OCLP-GUI.command
3+
/payloads/Apple
4+
/payloads/*.zip
5+
/payloads/BuildManifest.plist
6+
/payloads/*.sucatalog
7+
/payloads/*.pkg
8+
/payloads/__MACOSX
9+
/App
10+
/Build-Folder
11+
/build
12+
/dist
13+
/.vscode
14+
__pycache__/
15+
*.kext
16+
*.py[cod]
17+
*$py.class
18+
/docs/.vuepress/dist
19+
/docs/.vuepress/.config.js.swp
20+
/docs/yarn-error.log
21+
/docs/node_modules/
22+
/payloads/List.txt
23+
/payloads/Installer.sh
24+
/payloads/Info.plist
25+
/payloads/seed.plist
26+
/payloads/AutoPkg-Assets.pkg
27+
/payloads/AutoPkg-Assets.pkg.zip
28+
/payloads/Universal-Binaries
29+
/payloads/OpenCore-Legacy-Patcher
30+
/payloads/InstallAssistant.pkg.integrityDataV1
31+
/payloads.dmg
32+
/Universal-Binaries.dmg
33+
/payloads/OpenCore-Legacy-Patcher-*.plist
34+
/payloads/KDK.dmg
35+
*.log
36+
/Universal-Binaries.dmg
37+
/payloads/KDKInfo.plist
38+
/payloads/update.sh
39+
/payloads/OCLP-R.app
40+
/.x86_64_venv
41+
*afdesign~lock~
42+
main.py

.pylintrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[MASTER]
2+
3+
init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))"
4+
5+
[MESSAGES CONTROL]
6+
7+
disable=unused-import,
8+
subprocess-run-check,
9+
line-too-long,
10+
too-few-public-methods,
11+
missing-module-docstring,
12+
missing-class-docstring,
13+
missing-function-docstring

Build-Project.command

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Build-Project.command: Generate OCLP-R.app and OCLP-R.pkg
4+
"""
5+
6+
import os
7+
import sys
8+
import time
9+
import argparse
10+
11+
from pathlib import Path
12+
13+
from ci_tooling.build_modules import (
14+
application,
15+
disk_images,
16+
package,
17+
sign_notarize
18+
)
19+
20+
21+
def main() -> None:
22+
"""
23+
Parse Command Line Arguments
24+
"""
25+
26+
parser = argparse.ArgumentParser(description="Build OCLP-R Suite", add_help=False)
27+
28+
# Signing Parameters
29+
parser.add_argument("--application-signing-identity", type=str, help="Application Signing Identity")
30+
parser.add_argument("--installer-signing-identity", type=str, help="Installer Signing Identity")
31+
32+
33+
# Notarization Parameters
34+
parser.add_argument("--notarization-apple-id", type=str, help="Notarization Apple ID", default=None)
35+
parser.add_argument("--notarization-password", type=str, help="Notarization Password", default=None)
36+
parser.add_argument("--notarization-team-id", type=str, help="Notarization Team ID", default=None)
37+
38+
# GitHub Actions CI/CD Parameters
39+
parser.add_argument("--git-branch", type=str, help="Git Branch", default=None)
40+
parser.add_argument("--git-commit-url", type=str, help="Git Commit URL", default=None)
41+
parser.add_argument("--git-commit-date", type=str, help="Git Commit Date", default=None)
42+
43+
# Local Build Parameters
44+
parser.add_argument("--reset-dmg-cache", action="store_true", help="Redownload PatcherSupportPkg.dmg and regenerate payloads.dmg", default=False)
45+
parser.add_argument("--reset-pyinstaller-cache", action="store_true", help="Clean PyInstaller Cache", default=False)
46+
47+
# CI/CD Parameters for individual steps
48+
# If not specified, will run all steps
49+
parser.add_argument("--run-as-individual-steps", action="store_true", help="CI: Run as individual steps", default=False)
50+
parser.add_argument("--prepare-application", action="store_true", help="CI: Prepare Application", default=False)
51+
parser.add_argument("--prepare-package", action="store_true", help="CI: Prepare Package", default=False)
52+
parser.add_argument("--prepare-assets", action="store_true", help="CI: Prepare Assets", default=False)
53+
54+
# Analytics Parameters
55+
parser.add_argument("--analytics-key", type=str, help="Analytics Key", default=None)
56+
parser.add_argument("--analytics-endpoint", type=str, help="Analytics Endpoint", default=None)
57+
58+
# Help
59+
parser.add_argument("--help", action="store_true", help="Show this help message and exit", default=False)
60+
61+
# Parse Arguments
62+
args = parser.parse_args()
63+
64+
if args.help:
65+
parser.print_help()
66+
print("\n\nIf running outside of CI/CD, simply run the following command:")
67+
print("$ python3 Build-Project.command")
68+
sys.exit(0)
69+
70+
# Set 'Current Working Directory' to script directory
71+
os.chdir(Path(__file__).resolve().parent)
72+
73+
74+
if (args.run_as_individual_steps is False) or (args.run_as_individual_steps and args.prepare_assets):
75+
# Prepare workspace
76+
disk_images.GenerateDiskImages(args.reset_dmg_cache).generate()
77+
78+
if (args.run_as_individual_steps is False) or (args.run_as_individual_steps and args.prepare_application):
79+
# Prepare Privileged Helper Tool
80+
sign_notarize.SignAndNotarize(
81+
path=Path("./ci_tooling/privileged_helper_tool/com.pyquick.oclp-r.privileged-helper"),
82+
signing_identity=args.application_signing_identity,
83+
notarization_apple_id=args.notarization_apple_id,
84+
notarization_password=args.notarization_password,
85+
notarization_team_id=args.notarization_team_id,
86+
).sign_and_notarize()
87+
88+
# Build OCLP-R.app
89+
application.GenerateApplication(
90+
reset_pyinstaller_cache=args.reset_pyinstaller_cache,
91+
git_branch=args.git_branch,
92+
git_commit_url=args.git_commit_url,
93+
git_commit_date=args.git_commit_date,
94+
analytics_key=args.analytics_key,
95+
analytics_endpoint=args.analytics_endpoint,
96+
).generate()
97+
98+
# Sign OCLP-R.app
99+
sign_notarize.SignAndNotarize(
100+
path=Path("dist/OCLP-R.app"),
101+
signing_identity=args.application_signing_identity,
102+
notarization_apple_id=args.notarization_apple_id,
103+
notarization_password=args.notarization_password,
104+
notarization_team_id=args.notarization_team_id,
105+
entitlements=Path("./ci_tooling/entitlements/entitlements.plist"),
106+
).sign_and_notarize()
107+
108+
109+
if (args.run_as_individual_steps is False) or (args.run_as_individual_steps and args.prepare_package):
110+
# Build OCLP-R.pkg and OCLP-R-Uninstaller.pkg
111+
package.GeneratePackage().generate()
112+
113+
# Sign OCLP-R.pkg
114+
sign_notarize.SignAndNotarize(
115+
path=Path("dist/OCLP-R.pkg"),
116+
signing_identity=args.installer_signing_identity,
117+
notarization_apple_id=args.notarization_apple_id,
118+
notarization_password=args.notarization_password,
119+
notarization_team_id=args.notarization_team_id,
120+
).sign_and_notarize()
121+
122+
# Sign OCLP-R-Uninstaller.pkg
123+
sign_notarize.SignAndNotarize(
124+
path=Path("dist/OCLP-R-Uninstaller.pkg"),
125+
signing_identity=args.installer_signing_identity,
126+
notarization_apple_id=args.notarization_apple_id,
127+
notarization_password=args.notarization_password,
128+
notarization_team_id=args.notarization_team_id,
129+
).sign_and_notarize()
130+
131+
132+
if __name__ == '__main__':
133+
_start = time.time()
134+
main()
135+
print(f"Build script completed in {str(round(time.time() - _start, 2))} seconds")

0 commit comments

Comments
 (0)