Skip to content

Commit

Permalink
split romfs download out of python
Browse files Browse the repository at this point in the history
  • Loading branch information
WuBoytH committed Aug 2, 2024
1 parent b248bc5 commit d131aad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions scripts/full_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit d131aad

Please sign in to comment.