mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2025-01-12 03:09:09 +01:00
Merge branch 'main' of https://github.com/LSPosed/MagiskOnWSALocal
This commit is contained in:
commit
67f2d1b131
35
.github/workflows/build.yaml
vendored
35
.github/workflows/build.yaml
vendored
@ -57,18 +57,27 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
default: true
|
default: true
|
||||||
type: boolean
|
type: boolean
|
||||||
|
compression:
|
||||||
|
description: "Compression Algorithm"
|
||||||
|
required: true
|
||||||
|
default: "ZIP"
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- ZIP
|
||||||
|
- 7-Zip
|
||||||
|
- XZ
|
||||||
title:
|
title:
|
||||||
description: "Release title"
|
description: "Release Title"
|
||||||
required: true
|
required: true
|
||||||
default: "WSA"
|
default: "WSA"
|
||||||
type: string
|
type: string
|
||||||
tag:
|
tag:
|
||||||
description: "Release tag name"
|
description: "Release Tag Name"
|
||||||
required: true
|
required: true
|
||||||
default: "WSA"
|
default: "WSA"
|
||||||
type: string
|
type: string
|
||||||
prerelease:
|
prerelease:
|
||||||
description: "Release as prerelease"
|
description: "Release as Prerelease"
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
@ -85,7 +94,7 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
working-directory: ./scripts
|
working-directory: ./scripts
|
||||||
run: |
|
run: |
|
||||||
sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf e2fsprogs python3-pip aria2 attr
|
sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf e2fsprogs python3-pip aria2 p7zip-full attr xz-utils
|
||||||
python3 -m pip install requests
|
python3 -m pip install requests
|
||||||
cp -r ../wine/.cache/* ~/.cache
|
cp -r ../wine/.cache/* ~/.cache
|
||||||
winetricks msxml6
|
winetricks msxml6
|
||||||
@ -95,7 +104,7 @@ jobs:
|
|||||||
DOWNLOAD_DIR=../download
|
DOWNLOAD_DIR=../download
|
||||||
DOWNLOAD_CONF_NAME=download.list
|
DOWNLOAD_CONF_NAME=download.list
|
||||||
|
|
||||||
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" ["REMOVE_AMAZON,false"]="" )
|
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" ["REMOVE_AMAZON,false"]="" ["COMPRESSION,7-Zip"]="7z" ["COMPRESSION,XZ"]="xz")
|
||||||
|
|
||||||
ARCH="${opts[ARCH,${{ inputs.arch }}]}"
|
ARCH="${opts[ARCH,${{ inputs.arch }}]}"
|
||||||
|
|
||||||
@ -204,6 +213,10 @@ jobs:
|
|||||||
|
|
||||||
REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}"
|
REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}"
|
||||||
|
|
||||||
|
# if [[ "${{ inputs.compression }}" != "ZIP" ]]; then
|
||||||
|
# COMPRESSION="--compress --compress-format ${opts[COMPRESSION,${{ inputs.compression }}]}"
|
||||||
|
# fi
|
||||||
|
|
||||||
if [[ "${{ inputs.gapps_var }}" == "Custom"* ]]; then
|
if [[ "${{ inputs.gapps_var }}" == "Custom"* ]]; then
|
||||||
echo "Generate Download Links"
|
echo "Generate Download Links"
|
||||||
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME"
|
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME"
|
||||||
@ -219,7 +232,7 @@ jobs:
|
|||||||
OFFLINE="--offline"
|
OFFLINE="--offline"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --magisk-ver "$MAGISK_VER" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$REMOVE_AMAZON" --root-sol "$ROOT_SOL" "$CUSTOM_MAGISK" "$OFFLINE")
|
COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --magisk-ver "$MAGISK_VER" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$REMOVE_AMAZON" --root-sol "$ROOT_SOL" "$CUSTOM_MAGISK" "$OFFLINE" "$COMPRESSION")
|
||||||
echo "COMMAND_LINE=${COMMAND_LINE[*]}"
|
echo "COMMAND_LINE=${COMMAND_LINE[*]}"
|
||||||
|
|
||||||
chmod +x ./build.sh
|
chmod +x ./build.sh
|
||||||
@ -252,16 +265,24 @@ jobs:
|
|||||||
else
|
else
|
||||||
amazon="_Amazon-AppStore"
|
amazon="_Amazon-AppStore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "release_asset_name=WSA_${{ env.WSA_VER }}_${{ inputs.arch }}$magiskVer$gappsVar${amazon}" >> $GITHUB_ENV
|
echo "release_asset_name=WSA_${{ env.WSA_VER }}_${{ inputs.arch }}$magiskVer$gappsVar${amazon}" >> $GITHUB_ENV
|
||||||
- name: Compress Asset
|
- name: Compress Asset
|
||||||
working-directory: ./output
|
working-directory: ./output
|
||||||
run: |
|
run: |
|
||||||
find ./ -maxdepth 1 -type d -not -path './' -exec mv "{}" WSA \;
|
find ./ -maxdepth 1 -type d -not -path './' -exec mv "{}" WSA \;
|
||||||
|
|
||||||
|
if [[ "${{ inputs.compression }}" == "ZIP" ]]; then
|
||||||
zip -qrv "${{ env.release_asset_name }}.zip" ./*
|
zip -qrv "${{ env.release_asset_name }}.zip" ./*
|
||||||
|
elif [[ "${{ inputs.compression }}" == "7-Zip" ]]; then
|
||||||
|
7z a "${{ env.release_asset_name }}.7z" ./*
|
||||||
|
else
|
||||||
|
tar -cP -I 'xz -9 -T0' -f "${{ env.release_asset_name }}.tar.xz" ./*
|
||||||
|
fi
|
||||||
- name: Upload Asset
|
- name: Upload Asset
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: ./output/${{ env.release_asset_name }}.zip
|
files: ./output/${{ env.release_asset_name }}.*
|
||||||
name: ${{ inputs.title }}
|
name: ${{ inputs.title }}
|
||||||
tag_name: ${{ inputs.tag }}
|
tag_name: ${{ inputs.tag }}
|
||||||
prerelease: ${{ inputs.prerelease }}
|
prerelease: ${{ inputs.prerelease }}
|
||||||
|
@ -148,6 +148,12 @@ ROOT_SOL_MAP=(
|
|||||||
"magisk"
|
"magisk"
|
||||||
"none"
|
"none"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
COMPRESS_FORMAT_MAP=(
|
||||||
|
"7z"
|
||||||
|
"xz"
|
||||||
|
)
|
||||||
|
|
||||||
ARR_TO_STR() {
|
ARR_TO_STR() {
|
||||||
local arr=("$@")
|
local arr=("$@")
|
||||||
local joined
|
local joined
|
||||||
@ -190,9 +196,15 @@ usage() {
|
|||||||
Possible values: $(ARR_TO_STR "${ROOT_SOL_MAP[@]}")
|
Possible values: $(ARR_TO_STR "${ROOT_SOL_MAP[@]}")
|
||||||
Default: $ROOT_SOL
|
Default: $ROOT_SOL
|
||||||
|
|
||||||
|
--compress-format
|
||||||
|
Compress format of output file.
|
||||||
|
If this option is not specified and --compress is not specified, the generated file will not be compressed
|
||||||
|
|
||||||
|
Possible values: $(ARR_TO_STR "${COMPRESS_FORMAT_MAP[@]}")
|
||||||
|
|
||||||
Additional Options:
|
Additional Options:
|
||||||
--remove-amazon Remove Amazon AppStore from the system
|
--remove-amazon Remove Amazon Appstore from the system
|
||||||
--compress Compress the WSA
|
--compress Compress the WSA, The default format is 7z, you can use the format specified by --compress-format
|
||||||
--offline Build WSA offline
|
--offline Build WSA offline
|
||||||
--magisk-custom Install custom Magisk
|
--magisk-custom Install custom Magisk
|
||||||
--debug Debug build mode
|
--debug Debug build mode
|
||||||
@ -213,6 +225,7 @@ ARGUMENT_LIST=(
|
|||||||
"gapps-brand:"
|
"gapps-brand:"
|
||||||
"gapps-variant:"
|
"gapps-variant:"
|
||||||
"root-sol:"
|
"root-sol:"
|
||||||
|
"compress-format:"
|
||||||
"remove-amazon"
|
"remove-amazon"
|
||||||
"compress"
|
"compress"
|
||||||
"offline"
|
"offline"
|
||||||
@ -240,6 +253,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
--gapps-brand ) GAPPS_BRAND="$2"; shift 2 ;;
|
--gapps-brand ) GAPPS_BRAND="$2"; shift 2 ;;
|
||||||
--gapps-variant ) GAPPS_VARIANT="$2"; shift 2 ;;
|
--gapps-variant ) GAPPS_VARIANT="$2"; shift 2 ;;
|
||||||
--root-sol ) ROOT_SOL="$2"; shift 2 ;;
|
--root-sol ) ROOT_SOL="$2"; shift 2 ;;
|
||||||
|
--compress-format ) COMPRESS_FORMAT="$2"; shift 2 ;;
|
||||||
--remove-amazon ) REMOVE_AMAZON="remove"; shift ;;
|
--remove-amazon ) REMOVE_AMAZON="remove"; shift ;;
|
||||||
--compress ) COMPRESS_OUTPUT="yes"; shift ;;
|
--compress ) COMPRESS_OUTPUT="yes"; shift ;;
|
||||||
--offline ) OFFLINE="on"; shift ;;
|
--offline ) OFFLINE="on"; shift ;;
|
||||||
@ -252,6 +266,7 @@ done
|
|||||||
|
|
||||||
check_list() {
|
check_list() {
|
||||||
local input=$1
|
local input=$1
|
||||||
|
if [ -n "$input" ]; then
|
||||||
local name=$2
|
local name=$2
|
||||||
shift
|
shift
|
||||||
local arr=("$@")
|
local arr=("$@")
|
||||||
@ -266,6 +281,7 @@ check_list() {
|
|||||||
exit_with_message "Invalid $name: $input"
|
exit_with_message "Invalid $name: $input"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_list "$ARCH" "Architecture" "${ARCH_MAP[@]}"
|
check_list "$ARCH" "Architecture" "${ARCH_MAP[@]}"
|
||||||
@ -274,6 +290,7 @@ check_list "$MAGISK_VER" "Magisk Version" "${MAGISK_VER_MAP[@]}"
|
|||||||
check_list "$GAPPS_BRAND" "GApps Brand" "${GAPPS_BRAND_MAP[@]}"
|
check_list "$GAPPS_BRAND" "GApps Brand" "${GAPPS_BRAND_MAP[@]}"
|
||||||
check_list "$GAPPS_VARIANT" "GApps Variant" "${GAPPS_VARIANT_MAP[@]}"
|
check_list "$GAPPS_VARIANT" "GApps Variant" "${GAPPS_VARIANT_MAP[@]}"
|
||||||
check_list "$ROOT_SOL" "Root Solution" "${ROOT_SOL_MAP[@]}"
|
check_list "$ROOT_SOL" "Root Solution" "${ROOT_SOL_MAP[@]}"
|
||||||
|
check_list "$COMPRESS_FORMAT" "Compress Format" "${COMPRESS_FORMAT_MAP[@]}"
|
||||||
|
|
||||||
if [ "$DEBUG" ]; then
|
if [ "$DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
@ -836,10 +853,20 @@ fi
|
|||||||
if [ ! -d "$OUTPUT_DIR" ]; then
|
if [ ! -d "$OUTPUT_DIR" ]; then
|
||||||
mkdir -p "$OUTPUT_DIR"
|
mkdir -p "$OUTPUT_DIR"
|
||||||
fi
|
fi
|
||||||
if [ "$COMPRESS_OUTPUT" ]; then
|
if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
|
||||||
rm -f "${OUTPUT_DIR:?}"/"$artifact_name.7z" || abort
|
|
||||||
mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name"
|
mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name"
|
||||||
|
if [ "$COMPRESS_FORMAT" = "7z" ]; then
|
||||||
|
rm -f "${OUTPUT_DIR:?}"/"$artifact_name.7z" || abort
|
||||||
|
echo "Compressing with 7z"
|
||||||
7z a "$OUTPUT_DIR"/"$artifact_name.7z" "$WORK_DIR/wsa/$artifact_name" || abort
|
7z a "$OUTPUT_DIR"/"$artifact_name.7z" "$WORK_DIR/wsa/$artifact_name" || abort
|
||||||
|
elif [ "$COMPRESS_FORMAT" = "xz" ]; then
|
||||||
|
rm -f "${OUTPUT_DIR:?}"/"$artifact_name.tar.xz" || abort
|
||||||
|
echo "Compressing with tar xz"
|
||||||
|
if ! (tar -cP -I 'xz -9 -T0' -f "$OUTPUT_DIR"/"$artifact_name.tar.xz" "$WORK_DIR/wsa/$artifact_name"); then
|
||||||
|
echo "Out of memory? Trying again with single threads..."
|
||||||
|
tar -cPJvf "$OUTPUT_DIR"/"$artifact_name.tar.xz" "$WORK_DIR/wsa/$artifact_name" || abort
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
rm -rf "${OUTPUT_DIR:?}/${artifact_name}" || abort
|
rm -rf "${OUTPUT_DIR:?}/${artifact_name}" || abort
|
||||||
cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_DIR/$artifact_name" || abort
|
cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_DIR/$artifact_name" || abort
|
||||||
|
Loading…
x
Reference in New Issue
Block a user