Build and Release YTMusicUltimate and MaxMusic #35
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 and Release YTMusicUltimate and YTMUltimate+ | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| enable_rymd: | |
| description: "Integrate Return-YouTube-Music-Dislikes (YTMUltimate+)" | |
| type: boolean | |
| required: true | |
| default: false | |
| enable_ytmabc: | |
| description: "Integrate YTMABConfig (YTMUltimate+)" | |
| type: boolean | |
| required: true | |
| default: false | |
| enable_youmusicpip: | |
| description: "Integrate YouMusicPiP (YTMUltimate+)" | |
| type: boolean | |
| required: true | |
| default: false | |
| enable_volumeboostyt: | |
| description: "Integrate VolumeBoostYT (YTMUltimate+)" | |
| type: boolean | |
| required: true | |
| default: false | |
| ipa_url: | |
| description: "URL to the decrypted IPA file" | |
| default: "" | |
| required: true | |
| type: string | |
| display_name: | |
| description: "App Name (Optional)" | |
| default: "YouTube Music" | |
| required: true | |
| type: string | |
| bundle_id: | |
| description: "BundleID (Optional)" | |
| default: "com.google.ios.youtubemusic" | |
| required: true | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build YTMusicUltimate | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Main | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| path: MYmain | |
| submodules: recursive | |
| - name: Hide sensitive inputs | |
| uses: levibostian/action-hide-sensitive-inputs@v1 | |
| with: | |
| exclude_inputs: bundle_id,display_name,enable_rymd,enable_ytmabc,enable_youmusicpip,enable_volumeboostyt | |
| - name: Validate IPA URL | |
| run: | | |
| curl -L -r 0-1023 -o sample.part "${{ inputs.ipa_url }}" > /dev/null 2>&1 | |
| file_type=$(file --mime-type -b sample.part) | |
| if [[ "$file_type" != "application/x-ios-app" && "$file_type" != "application/zip" ]]; then | |
| echo "::error::Validation failed: The file is not a valid IPA file. Detected type: $file_type." | |
| exit 1 | |
| fi | |
| - name: Install Dependencies | |
| run: brew install make ldid | |
| - name: Set PATH environment variables | |
| run: | | |
| echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH | |
| echo "THEOS=${{ github.workspace }}/theos" >> $GITHUB_ENV | |
| - name: Cache Theos | |
| id: theos | |
| uses: actions/cache@v5.0.3 | |
| env: | |
| cache-name: theos_cache_9bc7340 | |
| with: | |
| path: theos/ | |
| key: ${{ env.cache-name }} | |
| restore-keys: ${{ env.cache-name }} | |
| - name: Setup Theos | |
| if: steps.theos.outputs.cache-hit != 'true' | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| repository: theos/theos | |
| ref: 9bc73406cf80b711ef4d02c15ff1dedc4478a275 | |
| path: theos | |
| submodules: recursive | |
| - name: Download iOS SDK | |
| if: steps.theos.outputs.cache-hit != 'true' | |
| run: | | |
| git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/theos/sdks.git | |
| cd sdks | |
| git sparse-checkout set --no-cone iPhoneOS16.5.sdk | |
| git checkout | |
| mv *.sdk $THEOS/sdks | |
| - name: Install cyan | |
| run: pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip | |
| - name: Download YouTube Music | |
| run: wget "${{ inputs.ipa_url }}" --no-verbose -O ytm.ipa | |
| - name: Get YouTube Music Version | |
| run: | | |
| unzip -q ytm.ipa -d ytmextracted | |
| echo "YTM_VERSION=$(grep -A 1 '<key>CFBundleVersion</key>' ytmextracted/Payload/YouTubeMusic.app/Info.plist | grep '<string>' | awk -F'[><]' '{print $3}')" >> $GITHUB_ENV | |
| - name: Clone YouTubeHeader | |
| run: | | |
| if [ -d "$THEOS/include/YouTubeHeader" ]; then | |
| cd $THEOS/include/YouTubeHeader && git pull | |
| else | |
| cd $THEOS/include && git clone --quiet --depth=1 https://github.com/PoomSmart/YouTubeHeader.git | |
| fi | |
| - name: Clone PSHeader | |
| run: | | |
| if [ -d "$THEOS/include/PSHeader" ]; then | |
| cd $THEOS/include/PSHeader && git pull | |
| else | |
| cd $THEOS/include && git clone --quiet --depth=1 https://github.com/PoomSmart/PSHeader.git | |
| fi | |
| - name: Clone YouTubeMusicHeader | |
| run: | | |
| if [ -d "$THEOS/include/YouTubeMusicHeader" ]; then | |
| cd $THEOS/include/YouTubeMusicHeader && git pull | |
| else | |
| cd $THEOS/include && git clone --quiet --depth=1 https://github.com/PoomSmart/YouTubeMusicHeader.git | |
| fi | |
| - name: Clone Return-YouTube-Dislikes (for Return-YouTube-Music-Dislikes) | |
| if: ${{ inputs.enable_rymd }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/Return-YouTube-Dislikes.git | |
| - name: Clone YouPiP (for YouMusicPiP) | |
| if: ${{ inputs.enable_youmusicpip }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouPiP.git | |
| - name: Clone Return-YouTube-Music-Dislikes | |
| if: ${{ inputs.enable_rymd }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/Return-YouTube-Music-Dislikes.git | |
| - name: Clone YTMABConfig | |
| if: ${{ inputs.enable_ytmabc }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YTMABConfig.git | |
| - name: Clone YouMusicPiP | |
| if: ${{ inputs.enable_youmusicpip }} | |
| run: git clone --quiet --depth=1 https://github.com/PoomSmart/YouMusicPiP.git | |
| - name: Clone VolumeBoostYT | |
| if: ${{ inputs.enable_volumeboostyt }} | |
| run: git clone --quiet --depth=1 https://github.com/VasirakCalgux/VolumeBoostYT.git | |
| - name: Build Return-YouTube-Music-Dislikes | |
| if: ${{ inputs.enable_rymd }} | |
| run: | | |
| cd Return-YouTube-Music-Dislikes && make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ../rymd.deb | |
| - name: Build YTMABConfig | |
| if: ${{ inputs.enable_ytmabc }} | |
| run: | | |
| cd YTMABConfig && make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ../ytmabc.deb | |
| - name: Build YouMusicPiP | |
| if: ${{ inputs.enable_youmusicpip }} | |
| run: | | |
| cd YouMusicPiP && make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
| mv packages/*.deb ../youmusicpip.deb | |
| - name: Build VolumeBoostYT | |
| if: ${{ inputs.enable_volumeboostyt }} | |
| run: | | |
| cd VolumeBoostYT && make clean package DEBUG=0 FINALPACKAGE=1 | |
| mv packages/*.deb ../volumeboostyt.deb | |
| - name: Build YTMusicUltimate | |
| run: | | |
| cd main | |
| make clean package DEBUG=0 FINALPACKAGE=1 SIDELOADING=1 | |
| mv packages/*.deb ../ytmult.deb | |
| - name: Determines the Release Title Prefix | |
| run: | | |
| if [ "${{ inputs.enable_rymd }}" = "false" ] && \ | |
| [ "${{ inputs.enable_volumeboostyt }}" = "false" ] && \ | |
| [ "${{ inputs.enable_youmusicpip }}" = "false" ] && \ | |
| [ "${{ inputs.enable_ytmabc }}" = "false" ]; then | |
| echo "RELEASE_PREFIX=YTMusicUltimate" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE_PREFIX=YTMUltimate+" >> $GITHUB_ENV | |
| fi | |
| - name: Inject tweak into provided IPA | |
| run: | | |
| cyan -i ytm.ipa -o ${{ env.RELEASE_PREFIX }}_2.4.1_${{ env.YTM_VERSION }}.ipa -uwsf *.deb -n "${{ inputs.display_name }}" -b ${{ inputs.bundle_id }} | |
| - name: Determines the Release Tag Release | |
| run: | | |
| if [ "${{ inputs.enable_rymd }}" = "false" ] && \ | |
| [ "${{ inputs.enable_volumeboostyt }}" = "false" ] && \ | |
| [ "${{ inputs.enable_youmusicpip }}" = "false" ] && \ | |
| [ "${{ inputs.enable_ytmabc }}" = "false" ]; then | |
| echo "TAG_PREFIX=YTMU" >> $GITHUB_ENV | |
| else | |
| echo "TAG_PREFIX=YTMU+" >> $GITHUB_ENV | |
| fi | |
| - name: Prepare Releases Notes | |
| run: | | |
| sed "s/%ytm_version%/${{ env.YTM_VERSION }}/g; s/%ytmult_version%/2.4.1/g; s/%release_prefix%/${{ env.RELEASE_PREFIX }}/g" \ | |
| .github/RELEASE_TEMPLATE/Release_Notes.md > release_notes_prepared.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ env.TAG.PREFIX }}_${{ env.YTM_VERSION }}_2.4.1 | |
| name: ${{ env.RELEASE_PREFIX }} 2.4.1 and ${{ env.YTM_VERSION }} (${{ github.run_number }}) | |
| files: ${{ env.RELEASE_PREFIX }}_2.4.1_${{ env.YTM_VERSION }}.ipa | |
| draft: true | |
| body_path: release_notes_prepared.md | |
| - name: Output Release URL | |
| run: | | |
| echo "::notice::Release available at: https://github.com/${{ github.repository }}/releases" |