mirror of
https://github.com/YTLitePlus/YTLitePlus.git
synced 2026-05-03 01:54:22 +00:00
Edit ipa_url.txt with a fresh download link, push, and the build auto-triggers. No workflow_dispatch UI needed. https://claude.ai/code/session_01FD8kBzc7yv5Fdf9G7Z2ZkE
137 lines
5.1 KiB
YAML
137 lines
5.1 KiB
YAML
name: Build YTLite IPA
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'claude/pull-upstream-Fzrqx'
|
|
paths:
|
|
- 'ipa_url.txt'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build YTLite IPA
|
|
runs-on: macos-13
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: main
|
|
submodules: recursive
|
|
|
|
- name: Read IPA URL and version from config
|
|
run: |
|
|
# Read URL (first non-comment, non-empty line)
|
|
IPA_URL=$(grep -v '^#' main/ipa_url.txt | grep -v '^\s*$' | head -1 | tr -d '[:space:]')
|
|
if [ -z "$IPA_URL" ]; then
|
|
echo "::error::No IPA URL found in ipa_url.txt. Paste a URL and push again."
|
|
exit 1
|
|
fi
|
|
echo ::add-mask::$IPA_URL
|
|
echo "IPA_URL=$IPA_URL" >> $GITHUB_ENV
|
|
|
|
# Read YouTube version from comment
|
|
YT_VERSION=$(grep '^# YOUTUBE_VERSION:' main/ipa_url.txt | head -1 | sed 's/^# YOUTUBE_VERSION:[[:space:]]*//')
|
|
YT_VERSION=${YT_VERSION:-"unknown"}
|
|
echo "YT_VERSION=$YT_VERSION" >> $GITHUB_ENV
|
|
|
|
# YTLite version from Makefile
|
|
YTLITE_VERSION=$(grep '^PACKAGE_VERSION' main/Makefile | sed 's/.*=[[:space:]]*//')
|
|
echo "YTLITE_VERSION=$YTLITE_VERSION" >> $GITHUB_ENV
|
|
|
|
echo "YouTube $YT_VERSION | YTLite $YTLITE_VERSION"
|
|
|
|
- name: Download and validate IPA
|
|
run: |
|
|
wget "$IPA_URL" --no-verbose -O ${{ github.workspace }}/youtube.ipa || true
|
|
|
|
if [ ! -f "${{ github.workspace }}/youtube.ipa" ] || [ ! -s "${{ github.workspace }}/youtube.ipa" ]; then
|
|
echo "::error::IPA download failed. Check your URL / token."
|
|
exit 1
|
|
fi
|
|
|
|
file_type=$(file --mime-type -b ${{ github.workspace }}/youtube.ipa)
|
|
if [[ "$file_type" != "application/x-ios-app" && "$file_type" != "application/zip" ]]; then
|
|
echo "::error::Not a valid IPA. Detected type: $file_type"
|
|
exit 1
|
|
fi
|
|
echo "IPA downloaded successfully."
|
|
|
|
- name: Install Dependencies
|
|
run: brew install ldid dpkg make
|
|
|
|
- name: Set PATH environment variable
|
|
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
|
|
|
|
- name: Setup Theos
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: theos/theos
|
|
ref: 67db2ab8d950910161730de77c322658ea3e6b44
|
|
path: ${{ github.workspace }}/theos
|
|
submodules: recursive
|
|
|
|
- name: Download iOS SDK
|
|
run: |
|
|
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/theos/sdks/
|
|
cd sdks
|
|
git sparse-checkout set --no-cone iPhoneOS16.5.sdk
|
|
git checkout
|
|
mv *.sdk $THEOS/sdks
|
|
env:
|
|
THEOS: ${{ github.workspace }}/theos
|
|
|
|
- name: Install cyan
|
|
run: pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
|
|
|
|
- name: Clone Dependencies
|
|
run: |
|
|
# Clone as siblings to main/ since source uses ../YouTubeHeader/ and ../protobuf/ relative paths
|
|
git clone --quiet --depth=1 https://github.com/PoomSmart/YouTubeHeader.git ${{ github.workspace }}/YouTubeHeader
|
|
git clone --quiet --depth=1 --branch v3.21.12 https://github.com/protocolbuffers/protobuf.git ${{ github.workspace }}/protobuf
|
|
|
|
- name: Create roothide stub
|
|
run: |
|
|
printf '#ifndef ROOTHIDE_H\n#define ROOTHIDE_H\n#ifndef jbroot\n#define jbroot(path) path\n#endif\n#ifndef rootfs\n#define rootfs(path) path\n#endif\n#endif\n' > $THEOS/include/roothide.h
|
|
env:
|
|
THEOS: ${{ github.workspace }}/theos
|
|
|
|
- name: Build YTLite
|
|
run: |
|
|
cd ${{ github.workspace }}/main
|
|
make clean package DEBUG=0 FINALPACKAGE=1
|
|
mv packages/*.deb ${{ github.workspace }}/ytlite.deb
|
|
env:
|
|
THEOS: ${{ github.workspace }}/theos
|
|
|
|
- name: Clone Open in YouTube (Safari extension)
|
|
run: |
|
|
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/CokePokes/YoutubeExtensions/
|
|
cd YoutubeExtensions
|
|
git sparse-checkout set --no-cone OpenYoutubeSafariExtension.appex
|
|
git checkout
|
|
mv *.appex ${{ github.workspace }}
|
|
|
|
- name: Inject tweak into IPA
|
|
run: |
|
|
cyan -i youtube.ipa -o YTLite_${YTLITE_VERSION}_YouTube-${YT_VERSION}.ipa -uwef ytlite.deb OpenYoutubeSafariExtension.appex
|
|
|
|
- name: Upload IPA as artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: YTLite_${{ env.YTLITE_VERSION }}_YouTube-${{ env.YT_VERSION }}
|
|
path: YTLite_${{ env.YTLITE_VERSION }}_YouTube-${{ env.YT_VERSION }}.ipa
|
|
|
|
- name: Upload to GitHub Releases
|
|
uses: softprops/action-gh-release@v2.0.1
|
|
with:
|
|
tag_name: ytlite-v${{ env.YTLITE_VERSION }}-yt${{ env.YT_VERSION }}
|
|
name: YTLite v${{ env.YTLITE_VERSION }} (YouTube ${{ env.YT_VERSION }})
|
|
files: YTLite_${{ env.YTLITE_VERSION }}_YouTube-${{ env.YT_VERSION }}.ipa
|
|
draft: true
|