Build YouTubePlus #90
This file contains 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 YouTubePlus | |
on: | |
workflow_dispatch: | |
inputs: | |
ytlite_deb_url: | |
description: "Direct URL of the YTLite deb file" | |
required: true | |
type: string | |
upload_artifacts: | |
description: "Upload artifacts" | |
required: false | |
default: true | |
type: boolean | |
release: | |
description: "Create a release" | |
required: false | |
type: boolean | |
default: false | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build YouTubePlus | |
runs-on: macos-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Main Repository | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
ref: ${{ github.event.inputs.commit_id || github.ref }} | |
submodules: recursive | |
- name: Install Dependencies | |
run: brew install dpkg | |
- name: Setup Theos | |
uses: Randomblock1/theos-action@v1 | |
with: | |
theos-src: "https://github.com/theos/theos" | |
- name: Cache iOS SDK | |
id: sdk-cache | |
uses: actions/cache@v4 | |
env: | |
cache-name: iOS-16.5-SDK | |
with: | |
path: theos/sdks/ | |
key: ${{ env.cache-name }} | |
- name: Download iOS 16.5 SDK | |
if: steps.sdk-cache.outputs.cache-hit != 'true' | |
run: | | |
git clone -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 | |
mkdir -p $THEOS/sdks | |
cp -r iPhoneOS16.5.sdk/* $THEOS/sdks/iPhoneOS16.5.sdk/ | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Setup Theos Jailed | |
uses: actions/checkout@v4 | |
with: | |
repository: qnblackcat/theos-jailed | |
ref: master | |
path: theos-jailed | |
submodules: recursive | |
- name: Update PATH for GNU Make | |
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH | |
- name: Install Theos Jailed | |
run: ./theos-jailed/install | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Prepare YTLite DEB Package | |
run: | | |
mkdir -p ${{ github.workspace }}/main/Tweaks/YTLite | |
cd ${{ github.workspace }}/main/Tweaks/YTLite | |
wget "${{ github.event.inputs.ytlite_deb_url }}" --no-verbose -O YTLite.deb | |
if file YTLite.deb | grep -q "Zip archive data"; then | |
echo "File is a zip. Extracting..." | |
unzip YTLite.deb | |
else | |
echo "File is a deb. Extracting..." | |
YTLITE_VERSION=$(dpkg-deb -f YTLite.deb Version) | |
echo "YTLITE_VERSION=${YTLITE_VERSION}" >> $GITHUB_ENV | |
tar -xf YTLite.deb && tar -xf data.tar.* | |
fi | |
find . -type d -name "*.bundle" -exec cp -r {} . \; | |
find . -type f -name "*.dylib" -exec cp -r {} . \; | |
- name: Build YouTubePlus Tweak | |
id: build_package | |
run: | | |
echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bash_profile | |
source ~/.bash_profile | |
cd ${{ github.workspace }}/main | |
make package FINALPACKAGE=1 | |
Version=$(grep '^Version' control | cut -d' ' -f2) | |
echo "Version=$Version" >> $GITHUB_OUTPUT | |
echo "==> Built v$Version Successfully." | |
cd packages | |
tweakName=$(ls *.deb) | |
echo "tweakName=${tweakName}" >> $GITHUB_OUTPUT | |
tar -xf ${tweakName}; tar -xf data.tar.* | |
mkdir output | |
cp -r Library/Application\ Support/*.bundle output | |
cp -r Library/MobileSubstrate/DynamicLibraries/*.dylib output | |
rm -rf output/YouTubePlus.* | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Upload Build Artifacts | |
if: ${{ github.event.inputs.upload_artifacts }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: YTPlus_${{ env.YTLITE_VERSION }} | |
path: main/packages/output/* | |
if-no-files-found: error | |
- name: Prepare Release | |
if: ${{ github.event.inputs.release }} | |
run: | | |
cd ${{ github.workspace }}/main/packages/output | |
zip -r YTPlus_${{ env.YTLITE_VERSION }}.zip * | |
- name: Release Package | |
if: ${{ github.event.inputs.release }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: main/packages/output/YTPlus_${{ env.YTLITE_VERSION }}.zip | |
tag_name: ${{ env.YTLITE_VERSION }} | |
generate_release_notes: true |