Refactor GitHub Actions workflow for build process

Updated build workflow to use macOS latest, improved caching, and modified paths for YouTube IPA preparation.
This commit is contained in:
aricloverEXTRA 2026-07-01 20:11:01 -05:00 committed by GitHub
parent 5fbde3d096
commit bb0887428c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,7 +51,7 @@ on:
default: false
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@ -59,7 +59,7 @@ concurrency:
jobs:
build:
name: Build uYouEnhanced
runs-on: macos-15
runs-on: macos-latest
permissions:
contents: write
@ -72,39 +72,46 @@ jobs:
submodules: recursive
- name: Install Dependencies
run: brew install ldid dpkg make
run: |
brew update
brew install ldid dpkg make wget unzip jq
- name: Set PATH environment variable
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
- name: Set GNU make PATH and THEOS
run: |
echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
echo "THEOS=${{ github.workspace }}/theos" >> $GITHUB_ENV
- name: Setup Theos
uses: actions/checkout@v7
- name: Cache Theos
id: cache-theos
uses: actions/cache@v6
with:
repository: theos/theos
ref: 9bc73406cf80b711ef4d02c15ff1dedc4478a275
path: theos
submodules: recursive
key: theos-${{ inputs.sdk_version }}-v1
- name: Setup Theos (if cache miss)
if: steps.cache-theos.outputs.cache-hit != 'true'
run: |
git clone --quiet --depth=1 --recurse-submodules https://github.com/theos/theos.git theos
# Optionally pin logos vendor if you need old behavior:
# cd theos/vendor/logos && git checkout a62370066a97e36d59b200a9fa10c5091f5e8972 || true
- name: SDK Caching
id: SDK
uses: actions/cache@v6
env:
cache-name: iOS-${{ inputs.sdk_version }}-SDK
with:
path: theos/sdks/
key: ${{ env.cache-name }}
restore-keys: ${{ env.cache-name }}
key: ios-sdk-${{ inputs.sdk_version }}
- name: Download iOS SDK
- name: Download iOS SDK (if cache miss)
if: steps.SDK.outputs.cache-hit != 'true'
run: |
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/aricloverALT/sdks/
cd sdks
git sparse-checkout set --no-cone iPhoneOS${{ inputs.sdk_version }}.sdk
git checkout
mv *.sdk $THEOS/sdks
env:
THEOS: ${{ github.workspace }}/theos
run: |
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/aricloverALT/sdks/ sdks
cd sdks
git sparse-checkout set --no-cone iPhoneOS${{ inputs.sdk_version }}.sdk
git checkout --quiet
mv *.sdk "$THEOS/sdks"
- name: Setup Theos Jailed
uses: actions/checkout@v7
@ -120,26 +127,6 @@ jobs:
env:
THEOS: ${{ github.workspace }}/theos
# YTUHD + Libraries (conditional)
- name: YTUHD + Libraries (dav1d + libvpx)
if: ${{ inputs.ytuhd }}
env:
THEOS: ${{ github.workspace }}/theos
run: |
set -euo pipefail
echo "⚠️ Installing YTUHD + required libraries (dav1d + libvpx)..."
# Ensure vendor directory exists in THEOS
mkdir -p "$THEOS/vendor"
# Clone libraries into THEOS vendor so YTUHD can use them
git clone --quiet --depth=1 https://code.videolan.org/videolan/dav1d.git "$THEOS/vendor/dav1d"
git clone --quiet --depth=1 https://chromium.googlesource.com/webm/libvpx "$THEOS/vendor/libvpx"
# Clone YTUHD into the workspace and build
git clone --quiet --depth=1 https://github.com/PoomSmart/YTUHD.git YTUHD
cd YTUHD
make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless || true
cd ..
echo "YTUHD + libraries prepared."
- name: Hash YT ipa url
run: |
URL_YT="$(jq -r '.inputs.decrypted_youtube_url' $GITHUB_EVENT_PATH)"
@ -148,66 +135,109 @@ jobs:
- name: Prepare YouTube iPA
id: prepare_youtube
run: |
wget "$YOUTUBE_URL" --quiet --no-verbose -O main/YouTube.ipa
cd ${{ github.workspace }}/main
mv YouTube.ipa YouTube.zip
unzip -q YouTube.zip
youtube_version=$(defaults read "$(pwd)/Payload/YouTube.app/Info" CFBundleVersion)
echo "==> YouTube v$youtube_version downloaded!"
sed -i '' "17s#.*#YOUTUBE_VERSION = ${youtube_version}#g" Makefile
echo "youtube_version=${youtube_version}" >> $GITHUB_OUTPUT
env:
THEOS: ${{ github.workspace }}/theos
YOUTUBE_URL: ${{ env.URL_YT }}
run: |
set -euo pipefail
mkdir -p main
wget "$YOUTUBE_URL" --quiet -O main/YouTube.ipa
cd main
mv YouTube.ipa YouTube.zip
unzip -q YouTube.zip
youtube_version=$(defaults read "$(pwd)/Payload/YouTube.app/Info" CFBundleVersion)
echo "youtube_version=${youtube_version}" >> $GITHUB_OUTPUT
echo "==> YouTube v$youtube_version downloaded!"
- name: Fix compiling & Build Package
id: build_package
run: |
cd ${{ github.workspace }}/main
sed -i '' "30s#.*#BUNDLE_ID = ${{ env.BUNDLE_ID }}#g" Makefile # Modify the bundle ID
sed -i '' "29s#.*#DISPLAY_NAME = ${{ env.APP_NAME }}#g" Makefile # Modify the app name
sed -i '' "1s#.*#export TARGET = iphone:clang:${{ inputs.sdk_version }}:16.0#g" Makefile # Modify the SDK version
# YTUHD Condition
if [ "${{ inputs.ytuhd }}" = "true" ]; then
echo "YTUHD_ENABLED=1" >> Makefile
else
echo "YTUHD_ENABLED=0" >> Makefile
fi
make package THEOS_PACKAGE_SCHEME=rootless IPA=Payload/YouTube.app FINALPACKAGE=1
echo "package=$(ls -t packages | head -n1)" >>$GITHUB_OUTPUT
echo -e "==> \033[1mSHASUM256: $(shasum -a 256 packages/*.ipa | cut -f1 -d' ')\033[0m"
echo -e "==> \033[1mBundle ID: ${{ env.BUNDLE_ID }}\033[0m"
env:
THEOS: ${{ github.workspace }}/theos
UYOU_VERSION: ${{ inputs.uyou_version }}
BUNDLE_ID: ${{ inputs.bundle_id }}
APP_NAME: ${{ inputs.app_name }}
run: |
set -euo pipefail
cd ${{ github.workspace }}/main
# Update Makefile values reliably (use sed -i compatible with macOS)
sed -i '' "s/^BUNDLE_ID *=.*$/BUNDLE_ID = $BUNDLE_ID/" Makefile || true
sed -i '' "s/^DISPLAY_NAME *=.*$/DISPLAY_NAME = $APP_NAME/" Makefile || true
sed -i '' "s/^export TARGET *=.*$/export TARGET = iphone:clang:${{ inputs.sdk_version }}:16.0/" Makefile || true
# Ensure YTUHD flag in Makefile is updated for the build
if [ "${{ inputs.ytuhd }}" = "true" ]; then
echo "YTUHD_ENABLED=1" >> Makefile
else
echo "YTUHD_ENABLED=0" >> Makefile
fi
make package THEOS_PACKAGE_SCHEME=rootless IPA=Payload/YouTube.app FINALPACKAGE=1 || true
echo "package=$(ls -t packages | head -n1)" >> $GITHUB_OUTPUT
echo -e "==> SHASUM256: $(shasum -a 256 packages/*.ipa | cut -f1 -d' ')"
echo -e "==> Bundle ID: $BUNDLE_ID"
- name: Clone Open in YouTube (Safari extension)
run: |
# match YouMod: fetch the known extension and move it to workflow root for cyan injection
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/BillyCurtis/OpenYouTubeSafariExtension.git OpenYouTubeSafariExtension || true
cd OpenYouTubeSafariExtension || exit 0
git sparse-checkout set --no-cone OpenYouTubeSafariExtension.appex || true
git checkout --quiet || true
mv *.appex "${{ github.workspace }}/" 2>/dev/null || true
- name: Prepare YTUHD vendor libs and build (optional)
if: ${{ inputs.ytuhd }}
env:
THEOS: ${{ github.workspace }}/theos
run: |
set -euo pipefail
echo "⚠️ Installing YTUHD + required libraries (dav1d + libvpx)..."
mkdir -p "$THEOS/vendor"
git clone --quiet --depth=1 https://code.videolan.org/videolan/dav1d.git "$THEOS/vendor/dav1d" || true
git clone --quiet --depth=1 https://chromium.googlesource.com/webm/libvpx "$THEOS/vendor/libvpx" || true
# Clone/build YTUHD locally so Makefile's SUBPROJECTS can find binaries if needed
rm -rf "${{ github.workspace }}/YTUHD" || true
git clone --quiet --depth=1 https://github.com/PoomSmart/YTUHD.git "${{ github.workspace }}/YTUHD" || true
cd "${{ github.workspace }}/YTUHD" && make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless || true
# move built packages up for later injection
mv packages/*.deb "${{ github.workspace }}/" 2>/dev/null || true
echo "YTUHD + libraries prepared."
- name: Collect built tweak packages
run: |
# Move any built .deb packages into the workflow root to be injected
for d in main/packages/*.deb YTUHD/packages/*.deb *.deb 2>/dev/null; do
[ -f "$d" ] && cp -n "$d" "$(basename "$d")" || true
done
ls -la *.deb || true
- name: Inject tweaks into IPA (cyan)
run: |
set -euo pipefail
IPA_IN="main/packages/${{ steps.build_package.outputs.package }}"
if [ ! -f "$IPA_IN" ]; then
# fallback if package path isn't populated the same way
IPA_IN=$(ls -t main/packages/*.ipa 2>/dev/null | head -n1 || echo "")
fi
[ -n "$IPA_IN" ] || (echo "::error::No IPA found to inject" && exit 1)
tweaks="OpenYouTubeSafariExtension.appex"
for f in *.deb; do
[ -f "$f" ] && tweaks="$tweaks $f" || true
done
echo "Injecting tweaks: $tweaks into $IPA_IN"
cyan -i "$IPA_IN" -o uYouEnhanced_${{ steps.prepare_youtube.outputs.youtube_version }}_v${{ inputs.uyou_version }}.ipa -uwef $tweaks -n "${{ inputs.app_name }}" -b ${{ inputs.bundle_id }} || true
ls -la *.ipa || true
- name: Upload Artifact
if: ${{ inputs.upload_artifact }}
uses: actions/upload-artifact@v7
env:
UYOU_VERSION: ${{ inputs.uyou_version }}
YOUTUBE_VERSION: ${{ steps.prepare_youtube.outputs.youtube_version }}
with:
name: uYouEnhanced_${{ env.YOUTUBE_VERSION }}_${{ env.UYOU_VERSION }}
path: ${{ github.workspace }}/main/packages/${{ steps.build_package.outputs.package }}
if-no-files-found: error
name: uYouEnhanced-${{ steps.prepare_youtube.outputs.youtube_version }}-uYou${{ inputs.uyou_version }}
path: uYouEnhanced_*.ipa
- name: Create Release
if: ${{ inputs.create_release }}
id: create_release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UYOU_VERSION: ${{ inputs.uyou_version }}
YOUTUBE_VERSION: ${{ steps.prepare_youtube.outputs.youtube_version }}
with:
tag_name: v${{ env.YOUTUBE_VERSION }}-${{ env.UYOU_VERSION }}-(${{ github.run_number }})
name: v${{ env.YOUTUBE_VERSION }}-${{ env.UYOU_VERSION }}-(${{ github.run_number }})
files: main/packages/*.ipa
tag_name: v${{ steps.prepare_youtube.outputs.youtube_version }}-uYou${{ inputs.uyou_version }}-${{ github.run_number }}
name: v${{ steps.prepare_youtube.outputs.youtube_version }}-uYou${{ inputs.uyou_version }}-${{ github.run_number }}
files: uYouEnhanced_*.ipa
draft: true