mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 06:30:52 +10:00
Add Commit Data to all builds
This commit is contained in:
@@ -10,11 +10,16 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build Offline TUI
|
name: Build Offline TUI
|
||||||
runs-on: x86_64_mojave
|
runs-on: x86_64_mojave
|
||||||
|
env:
|
||||||
|
commitmsg: ${{ github.event.head_commit.message }}
|
||||||
|
branch: ${{ github.event.ref }}
|
||||||
|
commiturl: ${{ github.event.head_commit.url }}
|
||||||
|
commitdate: ${{ github.event.head_commit.timestamp }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: python3 create_offline_build.py
|
- run: python3 create_offline_build.py
|
||||||
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec
|
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec
|
||||||
- run: python3 ./payloads/binary.py
|
- run: python3 ./payloads/binary.py $commitmsg $branch $commiturl $commitdate
|
||||||
- run: ./after_pyinstaller.sh
|
- run: ./after_pyinstaller.sh
|
||||||
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
||||||
- run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app
|
- run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build wxPython Offline
|
name: Build wxPython Offline
|
||||||
runs-on: x86_64_mojave
|
runs-on: x86_64_mojave
|
||||||
|
env:
|
||||||
|
commitmsg: ${{ github.event.head_commit.message }}
|
||||||
|
branch: ${{ github.event.ref }}
|
||||||
|
commiturl: ${{ github.event.head_commit.url }}
|
||||||
|
commitdate: ${{ github.event.head_commit.timestamp }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: python3 create_offline_build.py
|
- run: python3 create_offline_build.py
|
||||||
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
|
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
|
||||||
- run: python3 ./payloads/binary.py
|
- run: python3 ./payloads/binary.py $commitmsg $branch $commiturl $commitdate
|
||||||
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
||||||
- run: cd dist; zip -r ../OpenCore-Patcher-wxPython.app.zip OpenCore-Patcher.app
|
- run: cd dist; zip -r ../OpenCore-Patcher-wxPython.app.zip OpenCore-Patcher.app
|
||||||
- run: ./../sign-wxpython.sh
|
- run: ./../sign-wxpython.sh
|
||||||
|
|||||||
@@ -12,14 +12,13 @@ jobs:
|
|||||||
runs-on: x86_64_mojave
|
runs-on: x86_64_mojave
|
||||||
env:
|
env:
|
||||||
commitmsg: ${{ github.event.head_commit.message }}
|
commitmsg: ${{ github.event.head_commit.message }}
|
||||||
commitid: ${{ github.event.head_commit.id }}
|
|
||||||
branch: ${{ github.event.ref }}
|
branch: ${{ github.event.ref }}
|
||||||
commiturl: ${{ github.event.head_commit.url }}
|
commiturl: ${{ github.event.head_commit.url }}
|
||||||
commitdate: ${{ github.event.head_commit.timestamp }}
|
commitdate: ${{ github.event.head_commit.timestamp }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
|
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
|
||||||
- run: python3 ./payloads/binary.py $commitmsg $commitid $branch $commiturl $commitdate
|
- run: python3 ./payloads/binary.py $commitmsg $branch $commiturl $commitdate
|
||||||
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
||||||
- run: cd dist; zip -r ../OpenCore-Patcher-wxPython.app.zip OpenCore-Patcher.app
|
- run: cd dist; zip -r ../OpenCore-Patcher-wxPython.app.zip OpenCore-Patcher.app
|
||||||
- run: ./../sign-wxpython.sh
|
- run: ./../sign-wxpython.sh
|
||||||
|
|||||||
@@ -10,10 +10,15 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build TUI
|
name: Build TUI
|
||||||
runs-on: x86_64_mojave
|
runs-on: x86_64_mojave
|
||||||
|
env:
|
||||||
|
commitmsg: ${{ github.event.head_commit.message }}
|
||||||
|
branch: ${{ github.event.ref }}
|
||||||
|
commiturl: ${{ github.event.head_commit.url }}
|
||||||
|
commitdate: ${{ github.event.head_commit.timestamp }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec
|
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec
|
||||||
- run: python3 ./payloads/binary.py
|
- run: python3 ./payloads/binary.py $commitmsg $branch $commiturl $commitdate
|
||||||
- run: ./after_pyinstaller.sh
|
- run: ./after_pyinstaller.sh
|
||||||
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
||||||
- run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app
|
- run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
import sys, os, time
|
import sys, os, time, subprocess
|
||||||
sys.path.append(os.path.abspath(os.getcwd()))
|
sys.path.append(os.path.abspath(os.getcwd()))
|
||||||
from resources import constants
|
from resources import constants
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
@@ -51,4 +51,5 @@ app = BUNDLE(exe,
|
|||||||
"NSRequiresAquaSystemAppearance": False,
|
"NSRequiresAquaSystemAppearance": False,
|
||||||
"NSHighResolutionCapable": True,
|
"NSHighResolutionCapable": True,
|
||||||
"Build Date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
|
"Build Date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
|
||||||
|
"BuildMachineOSBuild": subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().strip(),
|
||||||
})
|
})
|
||||||
|
|||||||
+31
-37
@@ -1,16 +1,6 @@
|
|||||||
# Patches LC_VERSION_MIN_MACOSX in Load Command to report 10.10
|
# Handle Misc patching for binaries during commit
|
||||||
#
|
# This includes Load Command Patching as well as Info.plist patching
|
||||||
# By default Pyinstaller will create binaries supporting 10.13+
|
# Copyright (C) 2022 - Mykola Grymalyuk
|
||||||
# However this limitation is entirely arbitrary for our libraries
|
|
||||||
# and instead we're able to support 10.10 without issues.
|
|
||||||
#
|
|
||||||
# To verify set version:
|
|
||||||
# otool -l ./dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher
|
|
||||||
#
|
|
||||||
# cmd LC_VERSION_MIN_MACOSX
|
|
||||||
# cmdsize 16
|
|
||||||
# version 10.13
|
|
||||||
# sdk 10.9
|
|
||||||
import sys
|
import sys
|
||||||
import plistlib
|
import plistlib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -19,8 +9,20 @@ def main():
|
|||||||
patch_load_command()
|
patch_load_command()
|
||||||
patch_info_plist()
|
patch_info_plist()
|
||||||
|
|
||||||
|
|
||||||
def patch_load_command():
|
def patch_load_command():
|
||||||
|
# Patches LC_VERSION_MIN_MACOSX in Load Command to report 10.10
|
||||||
|
#
|
||||||
|
# By default Pyinstaller will create binaries supporting 10.13+
|
||||||
|
# However this limitation is entirely arbitrary for our libraries
|
||||||
|
# and instead we're able to support 10.10 without issues.
|
||||||
|
#
|
||||||
|
# To verify set version:
|
||||||
|
# otool -l ./dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher
|
||||||
|
#
|
||||||
|
# cmd LC_VERSION_MIN_MACOSX
|
||||||
|
# cmdsize 16
|
||||||
|
# version 10.13
|
||||||
|
# sdk 10.9
|
||||||
print("- Patching LC_VERSION_MIN_MACOSX")
|
print("- Patching LC_VERSION_MIN_MACOSX")
|
||||||
path = './dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher'
|
path = './dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher'
|
||||||
find = b'\x00\x0D\x0A\x00' # 10.13 (0xA0D)
|
find = b'\x00\x0D\x0A\x00' # 10.13 (0xA0D)
|
||||||
@@ -32,30 +34,22 @@ def patch_load_command():
|
|||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
def patch_info_plist():
|
def patch_info_plist():
|
||||||
|
# Add Commit Data to Info.plist
|
||||||
print("- Updating Info.plist")
|
print("- Updating Info.plist")
|
||||||
# Github Actions will supply us with the following environment variables:
|
|
||||||
# - Commit Message
|
|
||||||
# - Commit ID
|
|
||||||
# - Branch
|
|
||||||
# - Commit URL
|
|
||||||
# - Commit Date
|
|
||||||
|
|
||||||
argsv = sys.argv
|
argsv = sys.argv
|
||||||
argsv.pop(0)
|
argsv.pop(0)
|
||||||
plist_path = './dist/OpenCore-Patcher.app/Contents/Info.plist'
|
if argsv:
|
||||||
plist = plistlib.load(Path(plist_path).open("rb"))
|
plist_path = './dist/OpenCore-Patcher.app/Contents/Info.plist'
|
||||||
print("- Loaded Plist")
|
plist = plistlib.load(Path(plist_path).open("rb"))
|
||||||
# Add Github Dictonary
|
print("- Adding Github Dictionary")
|
||||||
print("- Adding Github Dictionary")
|
plist["Github"] = {
|
||||||
plist["Github"] = {
|
"Commit Message": argsv[0],
|
||||||
"Commit Message": argsv[0],
|
"Branch": argsv[1],
|
||||||
"Commit ID": argsv[1],
|
"Commit URL": argsv[2],
|
||||||
"Branch": argsv[2],
|
"Commit Date": argsv[3],
|
||||||
"Commit URL": argsv[3],
|
}
|
||||||
"Commit Date": argsv[4],
|
print("- Writing Plist")
|
||||||
}
|
plistlib.dump(plist, Path(plist_path).open("wb"), sort_keys=True)
|
||||||
print("- Writing Plist")
|
else:
|
||||||
plistlib.dump(plist, Path(plist_path).open("wb"), sort_keys=True)
|
print("- No commit data supplied, skipping")
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
Reference in New Issue
Block a user