From d131aad465f64c85c9707856e3ecd82aa0d5cbe5 Mon Sep 17 00:00:00 2001 From: WuBoytH Date: Fri, 2 Aug 2024 13:34:23 -0400 Subject: [PATCH] split romfs download out of python --- .github/workflows/build_prerelease.yml | 11 ++++++++++- scripts/full_package.py | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_prerelease.yml b/.github/workflows/build_prerelease.yml index 222f22a688..52616963bc 100644 --- a/.github/workflows/build_prerelease.yml +++ b/.github/workflows/build_prerelease.yml @@ -173,9 +173,18 @@ jobs: token: ${{ secrets.RELEASE_TOKEN }} repository: HDR-Development/romfs-release + - name: Download romfs + id: get_romfs + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: 'HDR-Development/romfs-release' + version: 'tags/${{ steps.romfs_version.outputs.release }}' + file: 'romfs.zip' + token: ${{ secrets.RELEASE_TOKEN }} + - name: make package run: | - python3 scripts/full_package.py ${{ needs.version_and_changelog.outputs.version }} ${{ steps.romfs_version.outputs.release }} + python3 scripts/full_package.py ${{ needs.version_and_changelog.outputs.version }} # get the most recent latest full release - id: package_latest diff --git a/scripts/full_package.py b/scripts/full_package.py index 6dd7f4a851..9adc0dedf1 100644 --- a/scripts/full_package.py +++ b/scripts/full_package.py @@ -13,7 +13,6 @@ exit(0) hdr_version = sys.argv[1] -romfs_version = sys.argv[2] shutil.rmtree("package", True) if os.path.exists("switch-package.zip"): @@ -33,6 +32,9 @@ def download_and_extract(owner: str, repo: str, tag: str, asset: str, extract_di print("getting release from url: " + url) urllib.request.urlretrieve(url, asset) + extract(asset, extract_directory) + +def extract(asset: str, extract_directory = None): with zipfile.ZipFile(asset, 'r') as zip_ref: if extract_directory: extract_home = extract_directory @@ -46,7 +48,7 @@ def download_and_extract(owner: str, repo: str, tag: str, asset: str, extract_di os.makedirs("switch-package/atmosphere/contents/01006A800016E000/romfs/skyline/plugins/") download_and_extract("HDR-Development", "HewDraw-Remix", hdr_version, "hdr-switch.zip") -download_and_extract("HDR-Development", "romfs-release", romfs_version, "romfs.zip") +extract("romfs.zip") download_and_extract("Raytwo", "ARCropolis", "latest", "release.zip") download_and_extract("skyline-dev", "skyline", "beta", "skyline.zip", "/atmosphere/contents/01006A800016E000/") download_and_extract("HDR-Development", "exlaunch", "latest", "HID-HDR.zip", "/atmosphere/contents/0100000000000013/exefs")