2022-08-29 23:32:14 +02:00
|
|
|
name: Build MagiskOnWSA
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
arch:
|
|
|
|
description: "WSA Architecture"
|
|
|
|
required: true
|
2022-08-30 04:05:55 +02:00
|
|
|
default: "x86_64"
|
2022-08-29 23:32:14 +02:00
|
|
|
type: choice
|
|
|
|
options:
|
2022-08-30 04:05:55 +02:00
|
|
|
- x86_64
|
2022-09-04 23:38:42 +02:00
|
|
|
- ARM64
|
2022-08-29 23:32:14 +02:00
|
|
|
release_type:
|
|
|
|
description: "WSA Release Channel"
|
|
|
|
required: true
|
|
|
|
default: "Dev Channel"
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- General Availability Channel
|
|
|
|
- Release Preview Channel
|
|
|
|
- Beta Channel
|
|
|
|
- Dev Channel
|
|
|
|
magisk_ver:
|
|
|
|
description: "Magisk Version"
|
|
|
|
required: true
|
|
|
|
default: "Stable"
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- None
|
|
|
|
- Stable
|
|
|
|
- Beta
|
|
|
|
- Canary
|
|
|
|
- Debug
|
2022-09-04 23:38:42 +02:00
|
|
|
- Custom
|
2022-08-29 23:32:14 +02:00
|
|
|
magisk_url:
|
|
|
|
description: "Custom Magisk APK/ZIP URL"
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
gapps_var:
|
|
|
|
description: "GApps Variant"
|
|
|
|
required: true
|
2022-09-12 21:13:39 +02:00
|
|
|
default: "MindTheGapps"
|
2022-08-29 23:32:14 +02:00
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- None
|
2022-09-04 23:41:28 +02:00
|
|
|
- Pico
|
|
|
|
- Full
|
2022-09-12 21:13:39 +02:00
|
|
|
- MindTheGapps
|
2022-09-04 23:38:42 +02:00
|
|
|
- Custom (OpenGApps)
|
|
|
|
- Custom (MindTheGapps)
|
|
|
|
gapps_url:
|
|
|
|
description: "Custom GApps ZIP URL"
|
2022-08-29 23:32:14 +02:00
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
remove_amazon:
|
|
|
|
description: "Remove Amazon AppStore"
|
2022-09-13 06:49:03 +02:00
|
|
|
required: true
|
2022-08-29 23:32:14 +02:00
|
|
|
default: true
|
|
|
|
type: boolean
|
2022-11-24 00:44:33 +01:00
|
|
|
# nofix_props:
|
|
|
|
# description: Props Remain Unfixed
|
|
|
|
# required: true
|
|
|
|
# default: false
|
|
|
|
# type: boolean
|
2022-12-10 00:18:19 +01:00
|
|
|
# skip_download_wsa:
|
|
|
|
# description: Skip WSA Download
|
|
|
|
# required: true
|
|
|
|
# default: false
|
|
|
|
# type: boolean
|
2022-10-22 02:18:10 +02:00
|
|
|
compression:
|
|
|
|
description: "Compression Algorithm"
|
|
|
|
required: true
|
|
|
|
default: "ZIP"
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- ZIP
|
|
|
|
- 7-Zip
|
|
|
|
- XZ
|
2022-09-08 21:22:54 +02:00
|
|
|
tag:
|
2022-10-22 02:18:10 +02:00
|
|
|
description: "Release Tag Name"
|
2022-09-13 06:49:03 +02:00
|
|
|
required: true
|
2022-09-08 21:22:54 +02:00
|
|
|
default: "WSA"
|
|
|
|
type: string
|
2022-09-08 21:31:15 +02:00
|
|
|
prerelease:
|
2022-10-22 02:18:10 +02:00
|
|
|
description: "Release as Prerelease"
|
2022-09-08 21:31:15 +02:00
|
|
|
required: false
|
|
|
|
default: false
|
|
|
|
type: boolean
|
2022-08-29 23:32:14 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-08-30 00:22:15 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-08-29 23:32:14 +02:00
|
|
|
- name: Install Dependencies
|
2022-08-30 01:10:44 +02:00
|
|
|
working-directory: ./scripts
|
2022-08-29 23:32:14 +02:00
|
|
|
run: |
|
2022-10-23 08:35:22 +02:00
|
|
|
sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf e2fsprogs python3-pip aria2 p7zip-full attr xz-utils unzip
|
2022-08-29 23:32:14 +02:00
|
|
|
python3 -m pip install requests
|
|
|
|
cp -r ../wine/.cache/* ~/.cache
|
|
|
|
winetricks msxml6
|
|
|
|
- name: Build MagiskOnWSA
|
2022-08-30 01:10:44 +02:00
|
|
|
working-directory: ./scripts
|
2022-08-29 23:32:14 +02:00
|
|
|
run: |
|
|
|
|
DOWNLOAD_DIR=../download
|
|
|
|
DOWNLOAD_CONF_NAME=download.list
|
2022-12-24 11:47:00 +01:00
|
|
|
mkdir -p "$DOWNLOAD_DIR"
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-12-10 00:18:19 +01:00
|
|
|
declare -A opts=( ["ARCH,x86_64"]="x64" ["ARCH,ARM64"]="arm64" ["RELEASE_TYPE,General Availability Channel"]="retail" ["RELEASE_TYPE,Release Preview Channel"]="RP" ["RELEASE_TYPE,Beta Channel"]="WIS" ["RELEASE_TYPE,Dev Channel"]="WIF" ["MAGISK_VER,Stable"]="stable" ["MAGISK_VER,Beta"]="beta" ["MAGISK_VER,Canary"]="canary" ["MAGISK_VER,Debug"]="debug" ["MAGISK_VER,Custom"]="--magisk-custom" ["GAPPS_VAR,None"]="none" ["GAPPS_VAR,Pico"]="pico" ["GAPPS_VAR,Full"]="full" ["REMOVE_AMAZON,true"]="--remove-amazon" ["NOFIX_PROPS,true"]="--nofix-props" ["SKIP_DOWNLOAD_WSA,true"]="--skip-download-wsa" ["COMPRESSION,ZIP"]="zip" ["COMPRESSION,7-Zip"]="7z" ["COMPRESSION,XZ"]="xz" )
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-08-29 23:32:14 +02:00
|
|
|
ARCH="${opts[ARCH,${{ inputs.arch }}]}"
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-08-29 23:32:14 +02:00
|
|
|
RELEASE_TYPE="${opts[RELEASE_TYPE,${{ inputs.release_type }}]}"
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "${{ inputs.magisk_ver }}" != "None" ]]; then
|
2022-08-29 23:32:14 +02:00
|
|
|
ROOT_SOL="magisk"
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "${{ inputs.magisk_ver }}" != "Custom" ]]; then
|
2022-08-29 23:32:14 +02:00
|
|
|
MAGISK_VER="${opts[MAGISK_VER,${{ inputs.magisk_ver }}]}"
|
|
|
|
else
|
2022-12-24 12:31:31 +01:00
|
|
|
echo -e "${{ inputs.magisk_url }}\n out=magisk-debug.zip" > "$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"
|
2022-08-29 23:32:14 +02:00
|
|
|
|
2022-12-24 12:15:02 +01:00
|
|
|
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_custom_magisk_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
|
2022-09-04 23:38:42 +02:00
|
|
|
echo "Magisk download error!"
|
2022-08-29 23:32:14 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-04 23:38:42 +02:00
|
|
|
CUSTOM_MAGISK="${opts[MAGISK_VER,Custom]}"
|
2022-08-29 23:32:14 +02:00
|
|
|
MAGISK_VER="${opts[MAGISK_VER,Debug]}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
ROOT_SOL="none"
|
|
|
|
MAGISK_VER="${opts[MAGISK_VER,Stable]}"
|
|
|
|
fi
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "${{ inputs.arch }}" == "x86_64" ]]; then
|
2022-08-30 03:24:10 +02:00
|
|
|
GAPPS_VAR="${opts[GAPPS_VAR,${{ inputs.gapps_var }}]}"
|
2022-08-29 23:32:14 +02:00
|
|
|
else
|
2022-08-30 03:24:10 +02:00
|
|
|
# TODO: keep it 11.0 since official opengapps does not support 12+ yet
|
|
|
|
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and download the corresponding version
|
2022-09-12 21:13:39 +02:00
|
|
|
if [[ "${{ inputs.gapps_var }}" != "None" ]]; then
|
2022-09-04 23:41:28 +02:00
|
|
|
GAPPS_VAR="${opts[GAPPS_VAR,Pico]}"
|
2022-08-30 03:24:10 +02:00
|
|
|
else
|
|
|
|
GAPPS_VAR="${opts[GAPPS_VAR,${{ inputs.gapps_var }}]}"
|
|
|
|
fi
|
2022-08-29 23:32:14 +02:00
|
|
|
fi
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "${{ inputs.gapps_var }}" != "None" ]]; then
|
2022-09-12 21:13:39 +02:00
|
|
|
if [[ "${{ inputs.gapps_var }}" != *"MindTheGapps"* ]]; then
|
2022-08-29 23:32:14 +02:00
|
|
|
GAPPS_BRAND="OpenGApps"
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "${{ inputs.gapps_var }}" == "Custom (OpenGApps)" ]]; then
|
|
|
|
if [[ -z "${${{ inputs.gapps_url }}+x}" ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
GAPPS_VARIANT_MAP=(
|
|
|
|
"super"
|
|
|
|
"stock"
|
|
|
|
"full"
|
|
|
|
"mini"
|
|
|
|
"micro"
|
|
|
|
"nano"
|
|
|
|
"pico"
|
|
|
|
"tvstock"
|
|
|
|
"tvmini"
|
|
|
|
)
|
|
|
|
|
|
|
|
for file in "$DOWNLOAD_DIR"/OpenGApps-"$ARCH"-*.zip; do
|
|
|
|
GAPPS_VAR=${file%%\.*}
|
|
|
|
GAPPS_VAR=${GAPPS_VAR##*-}
|
|
|
|
list_count=${#GAPPS_VARIANT_MAP[@]}
|
|
|
|
for i in "${GAPPS_VARIANT_MAP[@]}"; do
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "$GAPPS_VAR" == "$i" ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
echo "INFO: GApps Variant: $GAPPS_VAR"
|
|
|
|
valid_gapps_var="true"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
((list_count--))
|
|
|
|
if (("$list_count" <= 0)); then
|
|
|
|
echo "Invalid GApps Variant: $GAPPS_VAR"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [[ "$valid_gapps_var" == "true" ]]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [[ "$valid_gapps_var" != "true" ]]; then
|
|
|
|
echo "Missing OpenGApps file!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "opengapps_var=${GAPPS_VAR^}" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
GAPPS_VAR="pico"
|
2022-12-24 12:31:31 +01:00
|
|
|
echo -e "${{ inputs.gapps_url }}\n out=OpenGApps-"$ARCH"-"$GAPPS_VAR".zip" > -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"
|
2022-12-24 12:15:02 +01:00
|
|
|
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_gapps_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
|
2022-09-04 23:38:42 +02:00
|
|
|
echo "OpenGApps download error!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "opengapps_var=custom" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
fi
|
2022-08-29 23:32:14 +02:00
|
|
|
else
|
2022-09-12 21:13:39 +02:00
|
|
|
GAPPS_VAR="pico"
|
|
|
|
GAPPS_BRAND="MindTheGapps"
|
|
|
|
if [[ "${{ inputs.gapps_var }}" == "Custom (MindTheGapps)" ]]; then
|
|
|
|
if [[ -n "${${{ inputs.gapps_url }}+x}" ]]; then
|
2022-12-24 12:31:31 +01:00
|
|
|
echo -e "${{ inputs.gapps_url }}\n out=MindTheGapps-"$ARCH".zip" > -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"
|
2022-08-29 23:32:14 +02:00
|
|
|
|
2022-12-24 12:15:02 +01:00
|
|
|
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_gapps_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
|
2022-09-12 21:13:39 +02:00
|
|
|
echo "MindTheGapps download error!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2022-08-29 23:32:14 +02:00
|
|
|
fi
|
|
|
|
fi
|
2022-09-01 05:36:13 +02:00
|
|
|
else
|
2022-09-08 22:04:35 +02:00
|
|
|
GAPPS_VAR="pico"
|
2022-09-01 05:36:13 +02:00
|
|
|
GAPPS_BRAND="none"
|
2022-08-29 23:32:14 +02:00
|
|
|
fi
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-08-29 23:32:14 +02:00
|
|
|
REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}"
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-11-24 00:44:33 +01:00
|
|
|
NOFIX_PROPS="${opts[NOFIX_PROPS,${{ inputs.nofix_props }}]}"
|
|
|
|
|
2022-12-10 00:18:19 +01:00
|
|
|
SKIP_DOWNLOAD_WSA="${opts[SKIP_DOWNLOAD_WSA,${{ inputs.skip_download_wsa }}]}"
|
|
|
|
|
2022-10-25 02:59:37 +02:00
|
|
|
COMPRESSION="--compress --compress-format ${opts[COMPRESSION,${{ inputs.compression }}]}"
|
2022-10-22 02:18:10 +02:00
|
|
|
|
2022-09-12 21:13:39 +02:00
|
|
|
if [[ "${{ inputs.gapps_var }}" == "Custom"* ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
echo "Generate Download Links"
|
|
|
|
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME"
|
2022-09-04 23:58:06 +02:00
|
|
|
if [[ "${{ inputs.magisk_ver }}" != "Custom" ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Download Artifacts"
|
|
|
|
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
|
|
|
|
echo "Artifact download error!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-25 02:59:37 +02:00
|
|
|
OFFLINE="--offline"
|
2022-09-04 23:38:42 +02:00
|
|
|
fi
|
2022-08-30 00:38:06 +02:00
|
|
|
|
2022-12-10 00:18:19 +01:00
|
|
|
COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --root-sol "$ROOT_SOL" --magisk-ver "$MAGISK_VER" "$CUSTOM_MAGISK" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$COMPRESSION" "$REMOVE_AMAZON" "$NOFIX_PROPS" "$SKIP_DOWNLOAD_WSA" "$OFFLINE")
|
2022-08-29 23:32:14 +02:00
|
|
|
echo "COMMAND_LINE=${COMMAND_LINE[*]}"
|
2022-08-30 01:15:17 +02:00
|
|
|
|
2022-08-30 01:16:56 +02:00
|
|
|
chmod +x ./build.sh
|
2022-10-23 08:54:26 +02:00
|
|
|
./build.sh $(echo "${COMMAND_LINE[@]}")
|
2022-08-29 23:32:14 +02:00
|
|
|
- name: Generate Release Asset Name
|
2022-08-30 01:10:44 +02:00
|
|
|
working-directory: ./output
|
2022-08-29 23:32:14 +02:00
|
|
|
run: |
|
2022-08-30 02:31:10 +02:00
|
|
|
declare -A magisk_vers=( ["Stable"]="stable" ["Beta"]="beta" ["Canary"]="canary" ["Debug"]="debug" )
|
|
|
|
|
2022-08-30 03:55:19 +02:00
|
|
|
if [[ "${{ inputs.magisk_ver }}" == "None" ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
magiskVer=""
|
|
|
|
elif [[ "${{ inputs.magisk_ver }}" == "Custom" ]]; then
|
|
|
|
magiskVer="_Magisk-Custom"
|
2022-08-29 23:32:14 +02:00
|
|
|
else
|
2022-12-10 00:18:19 +01:00
|
|
|
magiskVer="_Magisk-${{ env.MAGISK_VERSION }}"
|
2022-08-29 23:32:14 +02:00
|
|
|
fi
|
2022-10-25 02:48:29 +02:00
|
|
|
export magiskVer
|
2022-08-29 23:32:14 +02:00
|
|
|
|
2022-08-30 03:49:47 +02:00
|
|
|
if [[ "${{ inputs.gapps_var }}" == "None" ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
gappsVar=""
|
2022-09-12 21:13:39 +02:00
|
|
|
elif [[ "${{ inputs.gapps_var }}" == *"MindTheGapps"* ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
gappsVar="_MindTheGapps"
|
|
|
|
elif [[ "${{ inputs.gapps_var }}" == "Custom (OpenGApps)" ]]; then
|
2022-09-08 23:43:38 +02:00
|
|
|
gappsVar="_OpenGApps-${{ env.opengapps_var }}"
|
2022-08-29 23:32:14 +02:00
|
|
|
else
|
2022-09-08 23:43:38 +02:00
|
|
|
gappsVar="_OpenGApps-${{ inputs.gapps_var }}"
|
2022-08-29 23:32:14 +02:00
|
|
|
fi
|
2022-10-25 02:48:29 +02:00
|
|
|
export gappsVar
|
2022-08-29 23:32:14 +02:00
|
|
|
|
2022-08-30 03:24:10 +02:00
|
|
|
if [[ "${{ inputs.remove_amazon }}" == "true" ]]; then
|
2022-09-04 23:38:42 +02:00
|
|
|
amazon=""
|
2022-08-29 23:32:14 +02:00
|
|
|
else
|
2022-09-04 23:38:42 +02:00
|
|
|
amazon="_Amazon-AppStore"
|
2022-08-29 23:32:14 +02:00
|
|
|
fi
|
2022-10-25 02:48:29 +02:00
|
|
|
export amazon
|
2022-10-22 02:18:10 +02:00
|
|
|
|
2022-09-08 23:40:41 +02:00
|
|
|
echo "release_asset_name=WSA_${{ env.WSA_VER }}_${{ inputs.arch }}$magiskVer$gappsVar${amazon}" >> $GITHUB_ENV
|
2022-10-25 02:48:29 +02:00
|
|
|
find . -maxdepth 1 -type f -name 'WSA.*' -exec bash -c 'mv "$1" "WSA_${{ env.WSA_VER }}_${{ inputs.arch }}${magiskVer}${gappsVar}${amazon}${1##*WSA}"' _ {} \;
|
2022-08-29 23:32:14 +02:00
|
|
|
- name: Upload Asset
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2022-10-22 02:18:10 +02:00
|
|
|
files: ./output/${{ env.release_asset_name }}.*
|
2022-10-22 02:28:07 +02:00
|
|
|
name: WSA
|
2022-09-08 21:22:54 +02:00
|
|
|
tag_name: ${{ inputs.tag }}
|
2022-09-08 21:31:15 +02:00
|
|
|
prerelease: ${{ inputs.prerelease }}
|