diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 976de96a..643cbc86 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,12 +3,24 @@ name: Build and Release YTMusicUltimate on: workflow_dispatch: inputs: - decrypted_youtube_music_url: - description: "The direct URL to the decrypted YouTube Music ipa (Upload a decrypted .ipa file to Dropbox and input its URL here.)" + ipa_url: + description: "URL to the decrypted IPA file" default: "" required: true - type: string - + 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 @@ -27,31 +39,46 @@ jobs: path: main submodules: recursive + - name: Hide sensitive inputs + uses: levibostian/action-hide-sensitive-inputs@v1 + + - 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 ldid dpkg make coreutils + run: brew install make ldid - name: Set PATH environment variable - run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH - - - name: Setup Theos - uses: actions/checkout@v4.1.7 - with: - repository: theos/theos - path: theos - submodules: recursive + run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH - - name: SDK Caching - id: SDK + - name: Cache Theos + id: theos uses: actions/cache@v4.0.1 env: - cache-name: iOS-16.5-SDK + cache-name: theos_cache_67db2ab with: - path: theos/sdks/ + path: theos/ key: ${{ env.cache-name }} restore-keys: ${{ env.cache-name }} + - name: Setup Theos + if: steps.theos.outputs.cache-hit != 'true' + uses: actions/checkout@v4.1.7 + with: + repository: theos/theos + ref: 67db2ab8d950910161730de77c322658ea3e6b44 + path: ${{ github.workspace }}/theos + submodules: recursive + - name: Download iOS SDK - if: steps.SDK.outputs.cache-hit != 'true' + if: steps.theos.outputs.cache-hit != 'true' run: | git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/theos/sdks/ cd sdks @@ -61,12 +88,12 @@ jobs: env: THEOS: ${{ github.workspace }}/theos - - name: Prepare YouTube Music iPA - id: prepare_youtube_music - run: wget "$YOUTUBE_MUSIC_URL" --no-verbose -O main/YouTubeMusic.ipa + - name: Install cyan + run: pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip - env: - YOUTUBE_MUSIC_URL: ${{ inputs.decrypted_youtube_music_url }} + - name: Download YouTube Music + id: download_youtube_music + run: wget "${{ inputs.ipa_url }}" --no-verbose -O ${{ github.workspace }}/main/ytm.ipa - name: Build Tweak for Sideloading id: build_package @@ -76,23 +103,20 @@ jobs: env: THEOS: ${{ github.workspace }}/theos - - name: Install Cyan - run: | - brew install pipx - pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip - - name: Inject tweak into provided IPA run: | cd ${{ github.workspace }}/main/packages tweakName=$(ls) cd ${{ github.workspace }}/main - cyan -i YouTubeMusic.ipa -o packages/YTMusicUltimate.ipa -uwsf packages/$tweakName + cyan -i ytm.ipa -o packages/YTMusicUltimate.ipa -uwsf packages/$tweakName -n "${{ inputs.display_name }}" -b ${{ inputs.bundle_id }} - name: Create Release - id: create_release uses: softprops/action-gh-release@v2.0.6 with: - tag_name: YTMusicUltimate-v${{ github.run_number }} name: YTMusicUltimate-v${{ github.run_number }} files: main/packages/*.ipa draft: true + + - name: Output Release URL + run: | + echo "::notice::Release available at: https://github.com/${{ github.repository }}/releases" \ No newline at end of file