feat: add pico variant

This commit is contained in:
Peter Njeim 2022-05-21 12:45:11 -03:00
parent aecebe7f78
commit 063008bd0e

View File

@ -230,11 +230,10 @@ jobs:
extract_as(zip, f"assets/boot_patch.sh", "boot_patch.sh", "magisk") extract_as(zip, f"assets/boot_patch.sh", "boot_patch.sh", "magisk")
extract_as(zip, f"assets/util_functions.sh", "util_functions.sh", "magisk") extract_as(zip, f"assets/util_functions.sh", "util_functions.sh", "magisk")
- name: Download OpenGApps - name: Download OpenGApps
if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' && github.event.inputs.gapps_version != '12.1' }} if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' }}
shell: python shell: python
run: | run: |
import requests import requests
import zipfile
import os import os
import urllib.request import urllib.request
import json import json
@ -244,31 +243,19 @@ jobs:
variant = "${{ github.event.inputs.gapps_variant }}" variant = "${{ github.event.inputs.gapps_variant }}"
abi_map = {"x64" : "x86_64", "arm64": "arm64"} abi_map = {"x64" : "x86_64", "arm64": "arm64"}
release = "${{ github.event.inputs.gapps_version }}" release = "${{ github.event.inputs.gapps_version }}"
try: if release == "12.1" and arch == "x64" and variant == "pico":
res = requests.get(f"https://api.opengapps.org/list") link = "http://peternjeim.ddns.net:8081/ipfs/Qmbh8NKAtiaYSgXHj7GTXMcU2AqxCp3jof31Gneffr8XNi"
j = json.loads(res.content) elif release == "12.1" and arch == "x64" and variant == "full":
link = {i["name"]: i for i in j["archs"][abi_map[arch]]["apis"][release]["variants"]}[variant]["zip"] link = "http://peternjeim.ddns.net:8081/ipfs/QmcWnPtdKR3pnmmkwcNhFwXbQtjuJfvK9irk2jurdC8K63"
except Exception: else:
print("Failed to fetch from opengapps api, fallbacking to sourceforge rss...") try:
res = requests.get(f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100') res = requests.get(f"https://api.opengapps.org/list")
link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace('.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps') j = json.loads(res.content)
link = {i["name"]: i for i in j["archs"][abi_map[arch]]["apis"][release]["variants"]}[variant]["zip"]
print(f"downloading link: {link}", flush=True) except Exception:
print("Failed to fetch from opengapps api, fallbacking to sourceforge rss...")
out_file = "gapps.zip" res = requests.get(f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100')
link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace('.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps')
if not os.path.isfile(out_file):
urllib.request.urlretrieve(link, out_file)
print("done", flush=True)
- name: Download OpenGApps
if: ${{ matrix.arch == 'x64' && github.event.inputs.gapps_variant == 'full' && github.event.inputs.gapps_version == '12.1' }}
shell: python
run: |
import os
import urllib.request
link = "http://peternjeim.ddns.net:8081/ipfs/Qmbh8NKAtiaYSgXHj7GTXMcU2AqxCp3jof31Gneffr8XNi"
print(f"downloading link: {link}", flush=True) print(f"downloading link: {link}", flush=True)