Skip to content

WSA Retail arm64 with KernelSU and MindTheGapps v13.0 #650

WSA Retail arm64 with KernelSU and MindTheGapps v13.0

WSA Retail arm64 with KernelSU and MindTheGapps v13.0 #650

Workflow file for this run

name: Custom Build (for testing purpose)
run-name: WSA ${{ inputs.release_type }} ${{ inputs.arch }} with ${{ inputs.root_sol }} and ${{ inputs.gapps_brand }}
on:
workflow_dispatch:
inputs:
arch:
type: choice
description: Target CPU architecture of WSA.
required: true
options: [x64, arm64]
default: x64
release_type:
type: choice
description: WSA Release Channel
required: true
options: ["Retail","Release Preview","Insider Slow","Insider Fast","Insider Private"]
default: "Retail"
user_code:
type: string
description: User code for WSA Insider User (Optional)
required: false
default: ""
gapps_brand:
type: choice
description: Google Apps brand
required: true
options: ["MindTheGapps v13.0","No GApps"]
default: "MindTheGapps v13.0"
root_sol:
type: choice
description: Root solution
required: true
options: ["Non-root","KernelSU","Magisk Official","Magisk Alpha (vvb2060)","Magisk Delta (HuskyDG)"]
default: "Magisk Official"
magisk_channel:
type: choice
description: Magisk channel
required: true
options: ["Magisk Stable","Magisk Beta","Magisk Canary","Magisk Debug"]
default: "Magisk Stable"
compression:
type: choice
description: Compression format.
required: true
options: [".zip",".7z"]
default: ".7z"
remove_amazon:
description: "Remove Amazon Appstore from the system"
required: true
default: true
type: boolean
jobs:
build:
name: Build WSA
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Checkout ♻️
uses: actions/checkout@v4
- name: Setup Python 👷
uses: actions/setup-python@v5
with:
check-latest: true
python-version: '3.10'
cache: 'pip'
cache-dependency-path: scripts/
- name: Setup Python3 Virtual Enviroment 🐍
working-directory: scripts
run: |
sudo apt-get update
PYTHON_VENV_DIR="$(dirname "$PWD")/python3-env"
python3 -m venv "$PYTHON_VENV_DIR" || abort "Failed to create python3 virtual env"
# shellcheck disable=SC1091
source "$PYTHON_VENV_DIR/bin/activate" || abort "Failed to activate python3 virtual env"
python3 -c "import pkg_resources; pkg_resources.require(open('requirements.txt',mode='r'))" &>/dev/null || {
echo "Installing Python3 dependencies"
python3 -m pip install --upgrade -r requirements.txt || abort "Failed to install python3 dependencies"
}
deactivate
- name: Install Ubuntu Dependencies 🧑‍🏭
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: e2fsprogs attr unzip qemu-utils python3-venv
version: 1.0
- name: Build WSA 🏗️
id: wsa
run: |
declare -A opts=( ["RELEASE_TYPE,Retail"]="retail" ["RELEASE_TYPE,Release Preview"]="RP" ["RELEASE_TYPE,Insider Slow"]="WIS" ["RELEASE_TYPE,Insider Fast"]="WIF" ["RELEASE_TYPE,Insider Private"]="latest" ["ROOT_SOL,Magisk Official"]="topjohnwu" ["ROOT_SOL,Magisk Delta (HuskyDG)"]="HuskyDG" ["ROOT_SOL,Magisk Alpha (vvb2060)"]="vvb2060" ["ROOT_SOL,KernelSU"]="kernelsu" ["ROOT_SOL,Non-root"]="none" ["MAGISK_TYPE,Magisk Stable"]="stable" ["MAGISK_TYPE,Magisk Beta"]="beta" ["MAGISK_TYPE,Magisk Canary"]="canary" ["MAGISK_TYPE,Magisk Debug"]="debug" ["CUSTOM_MODEL,WSA Default"]="none" ["CUSTOM_MODEL,Pixel 4a"]="sunfish" ["CUSTOM_MODEL,Pixel 4a (5G)"]="bramble" ["CUSTOM_MODEL,Pixel 5"]="redfin" ["CUSTOM_MODEL,Pixel 5a"]="barbet" ["CUSTOM_MODEL,Pixel 6 Pro"]="raven" ["CUSTOM_MODEL,Pixel 6"]="oriole" ["CUSTOM_MODEL,Pixel 6a"]="bluejay" ["CUSTOM_MODEL,Pixel 7"]="panther" ["CUSTOM_MODEL,Pixel 7 Pro"]="cheetah" ["CUSTOM_MODEL,Pixel 7a"]="lynx" ["CUSTOM_MODEL,Pixel Tablet"]="tangorpro" ["CUSTOM_MODEL,Pixel Fold"]="felix" ["GAPPS_BRAND,MindTheGapps v13.0"]="--install-gapps" )
mkdir -p download
echo -e "user_code=$(cat $GITHUB_EVENT_PATH | jq -r '.inputs.user_code')" > download/.ms_account
if [[ "${{ inputs.root_sol }}" == *Magisk* ]]; then
MAGISK_BRANCH="${opts[ROOT_SOL,${{ inputs.root_sol }}]}"
ROOT_SOL="magisk"
./scripts/build_with_lspinit.sh --arch ${{ inputs.arch }} --release-type ${opts[RELEASE_TYPE,${{ inputs.release_type }}]} --magisk-branch "$MAGISK_BRANCH" --magisk-ver "${opts[MAGISK_TYPE,${{ inputs.magisk_channel }}]}" --root-sol $ROOT_SOL ${opts[GAPPS_BRAND,${{ inputs.gapps_brand }}]} ${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}
else
MAGISK_BRANCH="topjohnwu"
ROOT_SOL="${opts[ROOT_SOL,${{ inputs.root_sol }}]}"
./scripts/build_with_mount.sh --arch ${{ inputs.arch }} --release-type ${opts[RELEASE_TYPE,${{ inputs.release_type }}]} --magisk-branch "$MAGISK_BRANCH" --magisk-ver "${opts[MAGISK_TYPE,${{ inputs.magisk_channel }}]}" --root-sol $ROOT_SOL ${opts[GAPPS_BRAND,${{ inputs.gapps_brand }}]} ${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}
fi
- name: Pass to Windows 💸
uses: actions/cache/save@v4
with:
path: output
key: ${{ steps.wsa.outputs.artifact }}-${{ steps.wsa.outputs.built }}
enableCrossOsArchive: true
outputs:
artifact: ${{ steps.wsa.outputs.artifact }}
built: ${{ steps.wsa.outputs.built }}
make-pri:
name: Merge PRI resources
runs-on: windows-latest
needs: build
steps:
- name: Checkout ♻️
uses: actions/checkout@v4
- name: Download built artifact ⌛
uses: actions/cache/restore@v4
with:
path: output
key: ${{ needs.build.outputs.artifact }}-${{ needs.build.outputs.built }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Merge language and density resources 🧙🏻‍♂️
run: |
if ("${{ inputs.arch }}" -eq "x64") {
(Start-Process pwsh.exe -NoNewWindow -PassThru -Args "-ExecutionPolicy Bypass -File MakePri.ps1" -WorkingDirectory "${{ github.workspace }}\output\${{ needs.build.outputs.artifact }}").WaitForExit()
} else {
Copy-Item -Force "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\arm64\makepri.exe" "${{ github.workspace }}\output\${{ needs.build.outputs.artifact }}"
}
- name: Compact Images 💿
run: |
foreach ($Partition in 'system','product','system_ext','vendor') {
Write-Output "Optimizing of $Partition..."
Write-Output "SELECT VDISK FILE=`"${{ github.workspace }}\output\${{ needs.build.outputs.artifact }}\$Partition.vhdx`"`
ATTACH VDISK READONLY`
COMPACT VDISK`
DETACH VDISK" | Set-Content -Path "$Partition.txt" -Encoding Ascii
Start-Process -NoNewWindow -Wait "diskpart.exe" -Args "/s $Partition.txt" -RedirectStandardOutput NUL
}
- name: Compress 7-Zip and Add checksum ✔️
if: inputs.compression == '.7z'
working-directory: output
run: |
7z a -t7z -mx=6 -m0=LZMA2 -ms=on -mmt=8 -sdel -- "${{ needs.build.outputs.artifact }}.7z" "${{ needs.build.outputs.artifact }}\*"
($(Get-FileHash -Path "${{ needs.build.outputs.artifact }}.7z" -Algorithm SHA256).Hash.ToLower().ToString() + " " + "${{ needs.build.outputs.artifact }}.7z") | Out-File -FilePath sha256-checksum.txt -Encoding UTF8
- name: Upload Artifact 📦
uses: actions/upload-artifact@v4
with:
name: ${{ needs.build.outputs.artifact }}-compressed
path: output