Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 84a20a5

Browse files
committedJan 9, 2025
improve workflow
1 parent 9e87234 commit 84a20a5

File tree

1 file changed

+55
-31
lines changed

1 file changed

+55
-31
lines changed
 

‎.github/workflows/main.yml

+55-31
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@ name: Build and Release YTMusicUltimate
33
on:
44
workflow_dispatch:
55
inputs:
6-
decrypted_youtube_music_url:
7-
description: "The direct URL to the decrypted YouTube Music ipa (Upload a decrypted .ipa file to Dropbox and input its URL here.)"
6+
ipa_url:
7+
description: "URL to the decrypted IPA file"
88
default: ""
99
required: true
10-
type: string
11-
10+
type: string
11+
12+
display_name:
13+
description: "App Name (Optional)"
14+
default: "YouTube Music"
15+
required: true
16+
type: string
17+
18+
bundle_id:
19+
description: "BundleID (Optional)"
20+
default: "com.google.ios.youtubemusic"
21+
required: true
22+
type: string
23+
1224
concurrency:
1325
group: ${{ github.workflow }}-${{ github.ref }}
1426
cancel-in-progress: true
@@ -27,31 +39,46 @@ jobs:
2739
path: main
2840
submodules: recursive
2941

42+
- name: Hide sensitive inputs
43+
uses: levibostian/action-hide-sensitive-inputs@v1
44+
45+
- name: Validate IPA URL
46+
run: |
47+
curl -L -r 0-1023 -o sample.part "${{ inputs.ipa_url }}" > /dev/null 2>&1
48+
file_type=$(file --mime-type -b sample.part)
49+
50+
if [[ "$file_type" != "application/x-ios-app" && "$file_type" != "application/zip" ]]; then
51+
echo "::error::Validation failed: The file is not a valid IPA file. Detected type: $file_type."
52+
exit 1
53+
fi
54+
3055
- name: Install Dependencies
31-
run: brew install ldid dpkg make coreutils
56+
run: brew install make ldid
3257

3358
- name: Set PATH environment variable
34-
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
35-
36-
- name: Setup Theos
37-
uses: actions/checkout@v4.1.7
38-
with:
39-
repository: theos/theos
40-
path: theos
41-
submodules: recursive
59+
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
4260

43-
- name: SDK Caching
44-
id: SDK
61+
- name: Cache Theos
62+
id: theos
4563
uses: actions/cache@v4.0.1
4664
env:
47-
cache-name: iOS-16.5-SDK
65+
cache-name: theos_cache_67db2ab
4866
with:
49-
path: theos/sdks/
67+
path: theos/
5068
key: ${{ env.cache-name }}
5169
restore-keys: ${{ env.cache-name }}
5270

71+
- name: Setup Theos
72+
if: steps.theos.outputs.cache-hit != 'true'
73+
uses: actions/checkout@v4.1.7
74+
with:
75+
repository: theos/theos
76+
ref: 67db2ab8d950910161730de77c322658ea3e6b44
77+
path: ${{ github.workspace }}/theos
78+
submodules: recursive
79+
5380
- name: Download iOS SDK
54-
if: steps.SDK.outputs.cache-hit != 'true'
81+
if: steps.theos.outputs.cache-hit != 'true'
5582
run: |
5683
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/theos/sdks/
5784
cd sdks
@@ -61,12 +88,12 @@ jobs:
6188
env:
6289
THEOS: ${{ github.workspace }}/theos
6390

64-
- name: Prepare YouTube Music iPA
65-
id: prepare_youtube_music
66-
run: wget "$YOUTUBE_MUSIC_URL" --no-verbose -O main/YouTubeMusic.ipa
91+
- name: Install cyan
92+
run: pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
6793

68-
env:
69-
YOUTUBE_MUSIC_URL: ${{ inputs.decrypted_youtube_music_url }}
94+
- name: Download YouTube Music
95+
id: download_youtube_music
96+
run: wget "${{ inputs.ipa_url }}" --no-verbose -O ${{ github.workspace }}/main/ytm.ipa
7097

7198
- name: Build Tweak for Sideloading
7299
id: build_package
@@ -76,23 +103,20 @@ jobs:
76103
env:
77104
THEOS: ${{ github.workspace }}/theos
78105

79-
- name: Install Cyan
80-
run: |
81-
brew install pipx
82-
pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
83-
84106
- name: Inject tweak into provided IPA
85107
run: |
86108
cd ${{ github.workspace }}/main/packages
87109
tweakName=$(ls)
88110
cd ${{ github.workspace }}/main
89-
cyan -i YouTubeMusic.ipa -o packages/YTMusicUltimate.ipa -uwsf packages/$tweakName
111+
cyan -i ytm.ipa -o packages/YTMusicUltimate.ipa -uwsf packages/$tweakName -n "${{ inputs.display_name }}" -b ${{ inputs.bundle_id }}
90112
91113
- name: Create Release
92-
id: create_release
93114
uses: softprops/action-gh-release@v2.0.6
94115
with:
95-
tag_name: YTMusicUltimate-v${{ github.run_number }}
96116
name: YTMusicUltimate-v${{ github.run_number }}
97117
files: main/packages/*.ipa
98118
draft: true
119+
120+
- name: Output Release URL
121+
run: |
122+
echo "::notice::Release available at: https://github.com/${{ github.repository }}/releases"

0 commit comments

Comments
 (0)
Please sign in to comment.