From d1af7d7a125cb3ad0176df2b1ef722a689f2034e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=9A=28noham=29=C2=B2?= <100566912+NohamR@users.noreply.github.com> Date: Sun, 3 May 2026 16:03:09 +0200 Subject: [PATCH] Add Build Tweak GitHub Actions workflow Add a new GitHub Actions workflow (.github/workflows/build.yml) to build iOS tweaks. --- .github/workflows/build.yml | 110 ++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e755313 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,110 @@ +name: Build Tweak +on: + push: + branches: [ "main" ] + workflow_dispatch: + inputs: + tweak: + description: 'Tweak folder to build (e.g., BusinessJB, CreditAgricoleJB, Infuse-iOS)' + required: false + default: 'BusinessJB' + branch: + description: 'Branch to build from' + required: false + default: 'main' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.tweak || 'BusinessJB' }} + cancel-in-progress: true + +jobs: + build: + name: Build ${{ inputs.tweak || 'BusinessJB' }} + runs-on: macos-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + ref: ${{ inputs.branch || github.ref }} + + - name: Install dependencies + run: brew install make ldid + + - name: Set PATH environment variables + run: | + echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH + echo "THEOS=${{ github.workspace }}/theos" >> $GITHUB_ENV + + # Original from YTweaks + - name: Get Theos commit + run: | + get_commit_hash() { + local repo_url=$1 + git ls-remote "$repo_url" HEAD | awk '{print substr($1,1,7)}' + } + echo "THEOS_COMMIT=$(get_commit_hash "https://github.com/roothide/theos")" >> $GITHUB_ENV + + - name: Cache Theos + id: cache-theos + uses: actions/cache@v5 + with: + path: theos + key: Tweak-18.6-SDK-${{ env.THEOS_COMMIT }} + + - name: Setup Theos + if: ${{ steps.cache-theos.outputs.cache-hit != 'true' }} + run: | + git clone --quiet --depth=1 --recurse-submodules https://github.com/roothide/theos.git + git clone --quiet --depth=1 -n --filter=tree:0 https://github.com/Tonwalter888/iOS-SDKs.git + cd iOS-SDKs + git sparse-checkout set --no-cone iPhoneOS18.6.sdk + git checkout --quiet + mv *.sdk "$THEOS/sdks" + + - name: Clone headers + run: | + if [ ! -d "$THEOS/include/YouTubeHeader" ]; then + git clone --quiet --depth=1 https://github.com/PoomSmart/YouTubeHeader.git "$THEOS/include/YouTubeHeader" + else + cd $THEOS/include/YouTubeHeader + git pull --quiet --force + cd ${{ github.workspace }} + fi + + if [ ! -d "$THEOS/include/PSHeader" ]; then + git clone --quiet --depth=1 https://github.com/PoomSmart/PSHeader.git "$THEOS/include/PSHeader" + else + cd $THEOS/include/PSHeader + git pull --quiet --force + cd ${{ github.workspace }} + fi + + - name: Build Tweak + run: | + TWEAK_NAME="${{ inputs.tweak || 'BusinessJB' }}" + cd "$TWEAK_NAME" + echo "TWEAK_VERSION=$(grep '^Version:' control | cut -d ' ' -f2)" >> $GITHUB_ENV + echo "TWEAK_NAME=$TWEAK_NAME" >> $GITHUB_ENV + make clean package DEBUG=0 FINALPACKAGE=1 + make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless + make clean package DEBUG=0 FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=roothide + mv packages/*.deb ${{ github.workspace }} + + - name: Upload the tweak .deb(s) + uses: actions/upload-artifact@v7 + with: + name: ${{ env.TWEAK_NAME }} v${{ env.TWEAK_VERSION }} + path: ${{ github.workspace }}/*.deb + if-no-files-found: error + overwrite: true + + - name: Create a draft release + uses: softprops/action-gh-release@v3 + with: + tag_name: ${{ env.TWEAK_NAME }}-v${{ env.TWEAK_VERSION }} + name: ${{ env.TWEAK_NAME }} v${{ env.TWEAK_VERSION }} + files: ${{ github.workspace }}/*.deb + draft: true \ No newline at end of file