Improve YouTube IPA preparation and build process
Some checks failed
Copilot Setup Steps / Validate Setup & Environment (push) Has been cancelled
Copilot Setup Steps / Collect Build Artifacts & Logs (push) Has been cancelled

Refactor YouTube IPA preparation and build steps, including error handling and environment variable management.
This commit is contained in:
aricloverEXTRA 2026-07-05 18:27:08 -05:00 committed by GitHub
parent 6b09a1a4c8
commit 5521e1f5bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,7 +93,7 @@ jobs:
path: theos/sdks/
key: iOS-${{ inputs.sdk_version }}-SDK
- name: Download iOS SDK
- name: Download iOS SDK (if cache miss)
if: steps.SDK.outputs.cache-hit != 'true'
run: |
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/aricloverALT/sdks/ sdks
@ -137,17 +137,18 @@ jobs:
git clone --quiet --depth=1 https://code.videolan.org/videolan/dav1d.git $THEOS/vendor/dav1d
git clone --quiet --depth=1 https://chromium.googlesource.com/webm/libvpx $THEOS/vendor/libvpx
git clone --quiet --depth=1 https://github.com/PoomSmart/YTUHD.git YTUHD
- name: Hash YT ipa url
run: |
URL_YT="$(jq -r '.inputs.decrypted_youtube_url' $GITHUB_EVENT_PATH)"
echo ::add-mask::$URL_YT
echo URL_YT=$URL_YT >> $GITHUB_ENV
env:
THEOS: ${{ github.workspace }}/theos
- name: Prepare YouTube iPA
id: prepare_youtube
run: |
wget "$YOUTUBE_URL" --quiet -O main/YouTube.ipa
set -e
if [ -z "${{ github.event.inputs.decrypted_youtube_url }}" ]; then
echo "No decrypted_youtube_url provided"
exit 1
fi
wget "${{ github.event.inputs.decrypted_youtube_url }}" --quiet -O main/YouTube.ipa
cd main
mv YouTube.ipa YouTube.zip
unzip -q YouTube.zip
@ -155,28 +156,25 @@ jobs:
echo "YT_VERSION=$youtube_version" >> $GITHUB_ENV
echo "youtube_version=${youtube_version}" >> $GITHUB_OUTPUT
env:
YOUTUBE_URL: ${{ env.URL_YT }}
- name: Fix compiling & Build Package
id: build_package
run: |
set -e
cd main
# Update Makefile
sed -i '' "s/^BUNDLE_ID .*/BUNDLE_ID = ${{ inputs.bundle_id }}/" Makefile || echo "BUNDLE_ID = ${{ inputs.bundle_id }}" >> Makefile
sed -i '' "s/^DISPLAY_NAME .*/DISPLAY_NAME = ${{ inputs.app_name }}/" Makefile || echo "DISPLAY_NAME = ${{ inputs.app_name }}" >> Makefile
sed -i '' "s/^export TARGET .*/export TARGET = iphone:clang:${{ inputs.sdk_version }}:16.0/" Makefile || echo "export TARGET = iphone:clang:${{ inputs.sdk_version }}:16.0" >> Makefile
# YTUHD flag
# Use portable replacements on macOS runner; if sed replace fails, append fallback lines.
perl -0777 -pe "s/^BUNDLE_ID\s*=.*$/BUNDLE_ID = ${{ inputs.bundle_id }}/m" -i Makefile || echo "BUNDLE_ID = ${{ inputs.bundle_id }}" >> Makefile
perl -0777 -pe "s/^DISPLAY_NAME\s*=.*$/DISPLAY_NAME = ${{ inputs.app_name }}/m" -i Makefile || echo "DISPLAY_NAME = ${{ inputs.app_name }}" >> Makefile
perl -0777 -pe "s/^export TARGET\s*=.*$/export TARGET = iphone:clang:${{ inputs.sdk_version }}:16.0/m" -i Makefile || echo "export TARGET = iphone:clang:${{ inputs.sdk_version }}:16.0" >> Makefile
if [ "${{ inputs.ytuhd }}" = "true" ]; then
echo "YTUHD_ENABLED=1" >> Makefile
grep -q '^YTUHD_ENABLED=1' Makefile || echo "YTUHD_ENABLED=1" >> Makefile
else
echo "YTUHD_ENABLED=0" >> Makefile
grep -q '^YTUHD_ENABLED=0' Makefile || echo "YTUHD_ENABLED=0" >> Makefile
fi
# Export the SDK override to the Makefile build environment
make package THEOS_PACKAGE_SCHEME=rootless IPA=Payload/YouTube.app FINALPACKAGE=1
echo "package=$(ls -t packages | head -n1)" >> $GITHUB_OUTPUT
env:
THEOS: ${{ github.workspace }}/theos
@ -193,7 +191,6 @@ jobs:
PARENT_BUNDLE="${{ inputs.bundle_id }}"
for appex in *.appex; do
if [ -f "$appex/Info.plist" ]; then
# Set extension ID to parent + .Extension (common pattern)
EXT_ID="${PARENT_BUNDLE}.Extension"
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $EXT_ID" "$appex/Info.plist" 2>/dev/null || true
echo "Set extension ID: $EXT_ID"