Build IPA with tweaks #84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build IPA with tweaks | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ipa_url: | |
| description: "URL to the decrypted IPA file" | |
| default: "" | |
| required: true | |
| type: string | |
| display_name: | |
| description: "App Name (Optional)" | |
| default: "YouTube" | |
| required: true | |
| type: string | |
| bundle_id: | |
| description: "Bundle ID (Optional)" | |
| default: "com.google.ios.youtube" | |
| required: true | |
| type: string | |
| youpip: | |
| description: "Integrate YouPiP" | |
| default: true | |
| required: false | |
| type: boolean | |
| ytuhd: | |
| description: "Integrate YTUHD" | |
| default: true | |
| required: false | |
| type: boolean | |
| ryd: | |
| description: "Integrate Return-YouTube-Dislikes" | |
| default: true | |
| required: false | |
| type: boolean | |
| abconfig: | |
| description: "Integrate YTABConfig" | |
| default: true | |
| required: false | |
| type: boolean | |
| youquality: | |
| description: "Integrate YouQuality" | |
| default: true | |
| required: false | |
| type: boolean | |
| youspeed: | |
| description: "Integrate YouSpeed" | |
| default: true | |
| required: false | |
| type: boolean | |
| demc: | |
| description: "Integrate DontEatMyContent" | |
| default: true | |
| required: false | |
| type: boolean | |
| youloop: | |
| description: "Integrate YouLoop" | |
| default: true | |
| required: false | |
| type: boolean | |
| ytweaks: | |
| description: "Integrate YTweaks" | |
| default: true | |
| required: false | |
| type: boolean | |
| youslider: | |
| description: "Integrate YouSlider" | |
| default: true | |
| required: false | |
| type: boolean | |
| ytholdspeed: | |
| description: "Integrate YTHoldForSpeed" | |
| default: true | |
| required: false | |
| type: boolean | |
| youchoose: | |
| description: "Integrate YouChooseQuality" | |
| default: true | |
| required: false | |
| type: boolean | |
| youshare: | |
| description: "Integrate YouShare" | |
| default: true | |
| required: false | |
| type: boolean | |
| getcap: | |
| description: "Integrate YouGetCaption" | |
| default: true | |
| required: false | |
| type: boolean | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build IPA with tweaks | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Hide Sensitive Inputs | |
| uses: levibostian/action-hide-sensitive-inputs@v1 | |
| with: | |
| exclude_inputs: bundle_id,display_name,youpip,ytuhd,ryd,abconfig,youquality,youspeed,youloop,ytweaks,youslider,ytholdspeed,youchoose,youshare,getcap,demc | |
| - name: Download and Validate IPA | |
| run: | | |
| wget "${{ inputs.ipa_url }}" --quiet --no-verbose -O youtube.ipa | |
| file_type=$(file --mime-type -b youtube.ipa) | |
| if [[ "$file_type" != "application/x-ios-app" && "$file_type" != "application/zip" ]]; then | |
| echo "::error::Validation failed: The downloaded file is not a valid IPA. Detected type: $file_type." | |
| exit 1 | |
| fi | |
| - name: Get YouTube Version | |
| run: | | |
| unzip -q youtube.ipa -d ytextracted | |
| echo "YT_VERSION=$(grep -A 1 '<key>CFBundleVersion</key>' ytextracted/Payload/YouTube.app/Info.plist | grep '<string>' | awk -F'[><]' '{print $3}')" >> $GITHUB_ENV | |
| - name: Install Dependencies | |
| run: brew install make ldid swiftlint | |
| - name: Set PATH Environment Variables | |
| run: | | |
| echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH | |
| echo "THEOS=${{ github.workspace }}/theos" >> $GITHUB_ENV | |
| # Original from YTweaks | |
| - name: Get tweaks commit | |
| run: | | |
| get_commit_hash() { | |
| local repo_url=$1 | |
| git ls-remote "$repo_url" HEAD | awk '{print substr($1,1,7)}' | |
| } | |
| echo "THEOS_COMMIT=$(get_commit_hash "https://github.com/theos/theos")" >> $GITHUB_ENV | |
| echo "OPENYT_COMMIT=$(get_commit_hash "https://github.com/BillyCurtis/OpenYouTubeSafariExtension")" >> $GITHUB_ENV | |
| echo "ALDERIS_COMMIT=$(get_commit_hash "https://github.com/hbang/Alderis")" >> $GITHUB_ENV | |
| - name: Cache Theos | |
| id: cache-theos | |
| uses: actions/cache@v5 | |
| with: | |
| path: theos | |
| key: 18.6-SDK-${{ env.THEOS_COMMIT }} | |
| - name: Setup Theos | |
| if: ${{ steps.cache-theos.outputs.cache-hit != 'true' }} | |
| run: | | |
| git clone --quiet --depth=1 --recurse-submodules https://github.com/theos/theos.git | |
| git clone --quiet --depth=1 -n --filter=tree:0 https://github.com/Tonwalter888/iOS-SDKs.git | |
| cd iOS-SDKs | |
| git sparse-checkout set --no-cone iPhoneOS18.6.sdk | |
| git checkout --quiet | |
| mv *.sdk "$THEOS/sdks" | |
| - name: Clone headers | |
| run: | | |
| if [ ! -d "$THEOS/include/YouTubeHeader" ]; then | |
| git clone --quiet --depth=1 https://github.com/PoomSmart/YouTubeHeader.git "$THEOS/include/YouTubeHeader" | |
| else | |
| cd $THEOS/include/YouTubeHeader | |
| git pull --quiet --force | |
| cd ${{ github.workspace }} | |
| fi | |
| if [ "${{ inputs.demc }}" = "true" ]; then | |
| rm -fr "$THEOS/include/YTHeaders" | |
| cp -r "$THEOS/include/YouTubeHeader" "$THEOS/include/YTHeaders" | |
| fi | |
| if [ ! -d "$THEOS/include/PSHeader" ]; then | |
| git clone --quiet --depth=1 https://github.com/PoomSmart/PSHeader.git "$THEOS/include/PSHeader" | |
| else | |
| cd $THEOS/include/PSHeader | |
| git pull --quiet --force | |
| cd ${{ github.workspace }} | |
| fi | |
| - name: Fix Theos od broken pipe issue | |
| run: sed -i '' 's/od -c "$i" | head/od -c "$i" 2>\/dev\/null | head/g' $THEOS/bin/convert_xml_plist.sh || true | |
| - name: Install cyan and tbd | |
| run: | | |
| pipx install https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip | |
| wget --quiet --no-verbose "https://github.com/inoahdev/tbd/releases/download/2.2/tbd-mac" -O /usr/local/bin/tbd | |
| chmod +x /usr/local/bin/tbd | |
| - name: Checkout YouMod | |
| uses: actions/checkout@v6 | |
| with: | |
| path: YouMod | |
| - name: Clone Open in YouTube (Safari Extension) | |
| run: | | |
| git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/BillyCurtis/OpenYouTubeSafariExtension.git | |
| cd OpenYouTubeSafariExtension | |
| git sparse-checkout set --no-cone OpenYouTubeSafariExtension.appex | |
| git checkout --quiet | |
| mv *.appex ${{ github.workspace }} | |
| - name: Clone YouPiP | |
| if: ${{ inputs.youpip }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouPiP.git | |
| - name: Clone YTUHD | |
| if: ${{ inputs.ytuhd }} | |
| run: git clone --quiet --depth=1 https://github.com/Tonwalter888/YTUHD.git | |
| - name: Clone Return-YouTube-Dislikes | |
| if: ${{ inputs.ryd }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/Return-YouTube-Dislikes.git | |
| - name: Clone YouGroupSettings | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouGroupSettings.git | |
| - name: Clone YTVideoOverlay | |
| if: ${{ inputs.youpip || inputs.ytuhd || inputs.youquality || inputs.youspeed || inputs.youloop || inputs.youshare || inputs.getcap }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YTVideoOverlay.git | |
| - name: Clone YTABConfig | |
| if: ${{ inputs.abconfig }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YTABConfig.git | |
| - name: Clone YouQuality | |
| if: ${{ inputs.youquality }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouQuality.git | |
| - name: Clone YouSpeed | |
| if: ${{ inputs.youspeed }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouSpeed.git | |
| - name: Clone DontEatMyContent | |
| if: ${{ inputs.demc }} | |
| run: git clone --quiet --depth=1 https://github.com/therealFoxster/DontEatMyContent.git | |
| - name: Clone YouLoop | |
| if: ${{ inputs.youloop }} | |
| run: git clone --quiet --depth=1 https://github.com/bhackel/YouLoop.git | |
| - name: Clone YouSlider | |
| if: ${{ inputs.youslider }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouSlider.git | |
| - name: Cache Alderis | |
| id: cache-alderis | |
| if: ${{ inputs.youslider }} | |
| uses: actions/cache@v5 | |
| with: | |
| path: Alderis | |
| key: Alderis-${{ env.ALDERIS_COMMIT }} | |
| - name: Clone Alderis | |
| if: ${{ inputs.youslider && steps.cache-alderis.outputs.cache-hit != 'true' }} | |
| run: git clone --quiet --depth=1 https://github.com/hbang/Alderis.git | |
| - name: Clone YTHoldForSpeed | |
| if: ${{ inputs.ytholdspeed }} | |
| run: git clone --quiet --depth=1 https://github.com/joshuaseltzer/YTHoldForSpeed.git | |
| - name: Clone YouChooseQuality | |
| if: ${{ inputs.youchoose }} | |
| run: git clone --quiet https://github.com/PoomSmart/YouChooseQuality.git | |
| - name: Clone YouShare | |
| if: ${{ inputs.youshare }} | |
| run: git clone --quiet --depth=1 https://github.com/Tonwalter888/YouShare.git | |
| - name: Clone YTweaks | |
| if: ${{ inputs.ytweaks }} | |
| run: git clone --quiet --depth=1 https://github.com/fosterbarnes/YTweaks.git | |
| - name: Clone YouGetCaption | |
| if: ${{ inputs.getcap }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouGetCaption.git | |
| - name: Build YouMod | |
| run: | | |
| cd YouMod | |
| echo "YOUMOD_VERSION=$(grep '^Version:' control | cut -d ' ' -f2)" >> $GITHUB_ENV | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youmod.deb | |
| - name: Build YouPiP | |
| if: ${{ inputs.youpip }} | |
| run: | | |
| cd YouPiP | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youpip.deb | |
| - name: Build YTUHD | |
| if: ${{ inputs.ytuhd }} | |
| run: | | |
| cd YTUHD | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ytuhd.deb | |
| - name: Build Return-YouTube-Dislikes | |
| if: ${{ inputs.ryd }} | |
| run: | | |
| cd Return-YouTube-Dislikes | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ryd.deb | |
| - name: Build YouGroupSettings | |
| run: | | |
| cd YouGroupSettings | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ygs.deb | |
| - name: Build YTVideoOverlay | |
| if: ${{ inputs.youpip || inputs.ytuhd || inputs.youquality || inputs.youspeed || inputs.youloop || inputs.youshare || inputs.getcap }} | |
| run: | | |
| cd YTVideoOverlay | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ytvo.deb | |
| - name: Build YTABConfig | |
| if: ${{ inputs.abconfig }} | |
| run: | | |
| cd YTABConfig | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ytabconfig.deb | |
| - name: Build YouQuality | |
| if: ${{ inputs.youquality }} | |
| run: | | |
| cd YouQuality | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youquality.deb | |
| - name: Build YouSpeed | |
| if: ${{ inputs.youspeed }} | |
| run: | | |
| cd YouSpeed | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youspeed.deb | |
| - name: Build DontEatMyContent | |
| if: ${{ inputs.demc }} | |
| run: | | |
| cd DontEatMyContent | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/demc.deb | |
| - name: Build YouLoop | |
| if: ${{ inputs.youloop }} | |
| run: | | |
| cd YouLoop | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youloop.deb | |
| - name: Build YouSlider | |
| if: ${{ inputs.youslider }} | |
| run: | | |
| cd YouSlider | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youslider.deb | |
| - name: Build Alderis | |
| if: ${{ inputs.youslider }} | |
| run: | | |
| cd Alderis | |
| make clean package DEBUG=0 FINALPACKAGE=1 ARCHS=arm64 | |
| mv packages/*.deb ${{ github.workspace }}/alderis.deb | |
| - name: Build YTHoldForSpeed | |
| if: ${{ inputs.ytholdspeed }} | |
| run: | | |
| cd YTHoldForSpeed | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless TARGET=iphone:clang:latest:15.0 ARCHS=arm64 | |
| mv packages/*.deb ${{ github.workspace }}/ytholdspeed.deb | |
| - name: Build YouChooseQuality | |
| if: ${{ inputs.youchoose }} | |
| run: | | |
| cd YouChooseQuality | |
| git checkout 1585a3691b2ef0b59d42c40c31639fd8b79e2cd4 | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youchoose.deb | |
| - name: Build YouShare | |
| if: ${{ inputs.youshare }} | |
| run: | | |
| cd YouShare | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/youshare.deb | |
| - name: Build YTweaks | |
| if: ${{ inputs.ytweaks }} | |
| run: | | |
| cd YTweaks | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ytweaks.deb | |
| - name: Build YouGetCaption | |
| if: ${{ inputs.getcap }} | |
| run: | | |
| cd YouGetCaption | |
| make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ${{ github.workspace }}/ygc.deb | |
| - name: Inject Tweaks Into IPA | |
| run: | | |
| tweaks="OpenYouTubeSafariExtension.appex" | |
| for f in *.deb; do | |
| tweaks="$tweaks $f" | |
| done | |
| cyan -i youtube.ipa -o YouMod_${{ env.YT_VERSION }}_v${{ env.YOUMOD_VERSION }}.ipa -uwef $tweaks -n "${{ inputs.display_name }}" -b ${{ inputs.bundle_id }} | |
| - name: Create a Draft Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: youmod-ipa${{ github.run_number }} | |
| name: YouMod_${{ env.YT_VERSION }}_v${{ env.YOUMOD_VERSION }} (${{ github.run_number }}) | |
| files: YouMod_${{ env.YT_VERSION }}_v${{ env.YOUMOD_VERSION }}.ipa | |
| draft: true | |
| - name: Job Summary - Build Complete | |
| run: | | |
| echo -e '### 🛠️ Build IPA with tweaks Complete!' >> $GITHUB_STEP_SUMMARY | |
| - name: Job Summary - Output the Draft Release Link | |
| run: | | |
| echo -e '### 🚀 Draft Release\n\nDraft release has been created successfully! You can view your release here: https://github.com/${{ github.repository }}/releases' >> $GITHUB_STEP_SUMMARY | |
| - name: Job Summary - Cleanup | |
| run: | | |
| echo -e '### 🧹 Cleanup\n\nYou can remove previous GitHub Actions run here: https://github.com/${{ github.repository }}/actions/workflows/delete-old-workflows-run.yml And if you want to delelte old draft releases you have then here: https://github.com/${{ github.repository }}/actions/workflows/delete-old-draft-releases.yml' >> $GITHUB_STEP_SUMMARY |