Skip to content

Commit

Permalink
CI: Publish automatic patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Aug 26, 2024
1 parent 8ae02ec commit 3ebfff2
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI - Patch latest Sequoia metallib's

on:
schedule:
- cron: "0 */2 * * *"
push:
branches:
- main

jobs:
build:
name: CI - Patch latest Sequoia metallib's
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install dependencies
run: python3 -m pip install -r requirements.txt

- name: Download latest Sequoia IPSW
run: echo "IPSW_FILE=$(python3 metallib.py --download --continuous-integration)" >> $GITHUB_OUTPUT
id: download

- name: Extract system volume
if: steps.download.outputs.IPSW_FILE != ''
run: echo "DMG_FILE=$(python3 metallib.py --extract ${{ steps.download.outputs.IPSW_FILE }})" >> $GITHUB_OUTPUT
id: extract

- name: Fetch metal libraries
if: steps.extract.outputs.DMG_FILE != ''
run: echo "BACKUP_FOLDER=$(python3 metallib.py --fetch ${{ steps.extract.outputs.DMG_FILE }})" >> $GITHUB_OUTPUT
id: fetch

- name: Patch metal libraries
if: steps.fetch.outputs.BACKUP_FOLDER != ''
run: python3 metallib.py --patch ${{ steps.fetch.outputs.BACKUP_FOLDER }}

- name: Build sys_patch_dict.py
if: steps.fetch.outputs.BACKUP_FOLDER != ''
run: python3 metallib.py --build-sys-patch ${{ steps.fetch.outputs.BACKUP_FOLDER }} --continuous-integration

- name: Build Package
if: steps.fetch.outputs.BACKUP_FOLDER != ''
run: python3 metallib.py --build-package ${{ steps.fetch.outputs.BACKUP_FOLDER }}

- name: Upload metal libraries to Artifactions
if: steps.fetch.outputs.BACKUP_FOLDER != ''
uses: actions/upload-artifact@v3
with:
name: MetallibSupportPkg.pkg
path: ./MetallibSupportPkg-*.pkg

- name: Upload sys_patch_dict.py to Artifactions
if: steps.fetch.outputs.BACKUP_FOLDER != ''
uses: actions/upload-artifact@v3
with:
name: sys_patch_dict.py
path: sys_patch_dict.py

- name: Create GitHub release
if: steps.fetch.outputs.BACKUP_FOLDER != ''
uses: softprops/action-gh-release@v1
with:
files: |
MetallibSupportPkg-*.pkg
sys_patch_dict.py
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.fetch.outputs.BACKUP_FOLDER }}
2 changes: 1 addition & 1 deletion metal_libraries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__title__ = "metal_libraries"
__version__ = "1.0.0"
__author__ = "Dortania"
__url__ = "https://www.github.com/khronokernel/MetallibSupportPkg"
__url__ = "https://www.github.com/dortania/MetallibSupportPkg"


from .cli import main
Expand Down
2 changes: 1 addition & 1 deletion metal_libraries/utils/ci_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class CIInfo:

def __init__(self) -> None:
self._url = "https://api.github.com/repos/khronokernel/MetallibSupportPkg/releases"
self._url = "https://api.github.com/repos/dortania/MetallibSupportPkg/releases"


def published_releases(self) -> list[str]:
Expand Down

0 comments on commit 3ebfff2

Please sign in to comment.