From 28ecca5ed094b4d22432abbec82f8a119376b3d8 Mon Sep 17 00:00:00 2001 From: naturecodevoid <44983869+naturecodevoid@users.noreply.github.com> Date: Sat, 3 Jun 2023 10:40:04 -0700 Subject: [PATCH] ci: make MDC ipa --- .github/workflows/beta.yml | 42 ++++++++++++++++++++++++++------- .github/workflows/nightly.yml | 44 +++++++++++++++++++++++++++-------- .github/workflows/pr.yml | 40 ++++++++++++++++++++++++------- .github/workflows/stable.yml | 42 ++++++++++++++++++++++++++------- .gitignore | 4 ++-- Build.xcconfig | 2 +- Makefile | 26 ++++++++++++++++----- 7 files changed, 154 insertions(+), 46 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 9718c667..a01b5307 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -42,14 +42,21 @@ jobs: with: xcode-version: ${{ matrix.version }} - - name: Build SideStore - run: make build | xcpretty && exit ${PIPESTATUS[0]} + - name: "[Normal] Build SideStore, fakesign app and convert to IPA" + run: | + make build | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa - - name: Fakesign app - run: make fakesign + - name: Enable MDC + run: make enable_mdc - - name: Convert to IPA - run: make ipa + - name: "[MDC] Build SideStore, fakesign app and convert to IPA" + run: | + make clean + make build DSYM_FOLDER=./MDC-dSYM | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa IPA_NAME=SideStore-MDC.ipa - name: Get current date id: date @@ -67,7 +74,9 @@ jobs: tag_name: ${{ github.ref_name }} draft: true prerelease: true - files: SideStore.ipa + files: | + SideStore.ipa + SideStore-MDC.ipa body: | Beta builds are hand-picked builds from development commits that will allow you to try out new features earlier than normal. However, **they might contain bugs and other issues. Use at your own risk!** @@ -86,14 +95,29 @@ jobs: - name: Add version to IPA file name run: mv SideStore.ipa SideStore-${{ steps.version.outputs.version }}.ipa + - name: Add version to MDC IPA file name + run: mv SideStore-MDC.ipa SideStore-MDC-${{ steps.version.outputs.version }}.ipa + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}.ipa path: SideStore-${{ steps.version.outputs.version }}.ipa - - name: Upload *.dSYM Artifact + - name: Upload SideStore-MDC.ipa Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + path: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + + - name: Upload dSYM Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}-dSYM - path: ./*.dSYM/ + path: ./dSYM/* + + - name: Upload MDC-dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}-dSYM + path: ./MDC-dSYM/* diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9b332aa2..10beaefe 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -40,7 +40,7 @@ jobs: run: sed -e 's/= Neon/= Steel/' -i '' ./AltStore.xcodeproj/project.pbxproj - name: Enable unstable features - run: echo '\nSWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) UNSTABLE' >> ./Build.xcconfig + run: make enable_unstable - name: Get version id: version @@ -54,14 +54,21 @@ jobs: with: xcode-version: ${{ matrix.version }} - - name: Build SideStore - run: make build | xcpretty && exit ${PIPESTATUS[0]} + - name: "[Normal] Build SideStore, fakesign app and convert to IPA" + run: | + make build | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa - - name: Fakesign app - run: make fakesign + - name: Enable MDC + run: make enable_mdc - - name: Convert to IPA - run: make ipa + - name: "[MDC] Build SideStore, fakesign app and convert to IPA" + run: | + make clean + make build DSYM_FOLDER=./MDC-dSYM | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa IPA_NAME=SideStore-MDC.ipa - name: Get current date id: date @@ -78,7 +85,9 @@ jobs: release: "Nightly" tag: "nightly" prerelease: true - files: SideStore.ipa + files: | + SideStore.ipa + SideStore-MDC.ipa body: | This is an ⚠️ **EXPERIMENTAL** ⚠️ nightly build for commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}). @@ -96,17 +105,32 @@ jobs: - name: Add version to IPA file name run: mv SideStore.ipa SideStore-${{ steps.version.outputs.version }}.ipa + - name: Add version to MDC IPA file name + run: mv SideStore-MDC.ipa SideStore-MDC-${{ steps.version.outputs.version }}.ipa + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}.ipa path: SideStore-${{ steps.version.outputs.version }}.ipa - - name: Upload *.dSYM Artifact + - name: Upload SideStore-MDC.ipa Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + path: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + + - name: Upload dSYM Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}-dSYM - path: ./*.dSYM/ + path: ./dSYM/* + + - name: Upload MDC-dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}-dSYM + path: ./MDC-dSYM/* - name: Reset cache for apps.sidestore.io/nightly run: sleep 10 && curl https://apps.sidestore.io/reset-cache/nightly/${{ secrets.SIDESOURCE_KEY }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2ab23dfc..d908a3bf 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -31,7 +31,7 @@ jobs: run: sed -e 's/= Neon/= Storm/' -i '' ./AltStore.xcodeproj/project.pbxproj - name: Enable unstable features - run: echo '\nSWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) UNSTABLE' >> ./Build.xcconfig + run: make enable_unstable - name: Get version id: version @@ -45,26 +45,48 @@ jobs: with: xcode-version: ${{ matrix.version }} - - name: Build SideStore - run: make build | xcpretty && exit ${PIPESTATUS[0]} + - name: "[Normal] Build SideStore, fakesign app and convert to IPA" + run: | + make build | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa - - name: Fakesign app - run: make fakesign + - name: Enable MDC + run: make enable_mdc - - name: Convert to IPA - run: make ipa + - name: "[MDC] Build SideStore, fakesign app and convert to IPA" + run: | + make clean + make build DSYM_FOLDER=./MDC-dSYM | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa IPA_NAME=SideStore-MDC.ipa - name: Add version to IPA file name run: mv SideStore.ipa SideStore-${{ steps.version.outputs.version }}.ipa + - name: Add version to MDC IPA file name + run: mv SideStore-MDC.ipa SideStore-MDC-${{ steps.version.outputs.version }}.ipa + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}.ipa path: SideStore-${{ steps.version.outputs.version }}.ipa - - name: Upload *.dSYM Artifact + - name: Upload SideStore-MDC.ipa Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + path: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + + - name: Upload dSYM Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}-dSYM - path: ./*.dSYM/ + path: ./dSYM/* + + - name: Upload MDC-dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}-dSYM + path: ./MDC-dSYM/* diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index d1a6d1e5..cddb73e4 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -39,14 +39,21 @@ jobs: with: xcode-version: ${{ matrix.version }} - - name: Build SideStore - run: make build | xcpretty && exit ${PIPESTATUS[0]} + - name: "[Normal] Build SideStore, fakesign app and convert to IPA" + run: | + make build | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa - - name: Fakesign app - run: make fakesign + - name: Enable MDC + run: make enable_mdc - - name: Convert to IPA - run: make ipa + - name: "[MDC] Build SideStore, fakesign app and convert to IPA" + run: | + make clean + make build DSYM_FOLDER=./MDC-dSYM | xcpretty && exit ${PIPESTATUS[0]} + make fakesign + make ipa IPA_NAME=SideStore-MDC.ipa - name: Get current date id: date @@ -63,7 +70,9 @@ jobs: name: ${{ steps.version.outputs.version }} tag_name: ${{ github.ref_name }} draft: true - files: SideStore.ipa + files: | + SideStore.ipa + SideStore-MDC.ipa body: | ## Changelog @@ -80,14 +89,29 @@ jobs: - name: Add version to IPA file name run: mv SideStore.ipa SideStore-${{ steps.version.outputs.version }}.ipa + - name: Add version to MDC IPA file name + run: mv SideStore-MDC.ipa SideStore-MDC-${{ steps.version.outputs.version }}.ipa + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}.ipa path: SideStore-${{ steps.version.outputs.version }}.ipa - - name: Upload *.dSYM Artifact + - name: Upload SideStore-MDC.ipa Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + path: SideStore-MDC-${{ steps.version.outputs.version }}.ipa + + - name: Upload dSYM Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore-${{ steps.version.outputs.version }}-dSYM - path: ./*.dSYM/ + path: ./dSYM/* + + - name: Upload MDC-dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-MDC-${{ steps.version.outputs.version }}-dSYM + path: ./MDC-dSYM/* diff --git a/.gitignore b/.gitignore index 9e0fcf89..d852dfd8 100644 --- a/.gitignore +++ b/.gitignore @@ -36,8 +36,8 @@ xcuserdata .idea/ Payload/ -SideStore.ipa -*.dSYM +SideStore*.ipa +*dSYM Dependencies/.*-prebuilt-fetch-* Dependencies/minimuxer/* diff --git a/Build.xcconfig b/Build.xcconfig index 31a89971..74b66906 100644 --- a/Build.xcconfig +++ b/Build.xcconfig @@ -18,7 +18,7 @@ ORG_PREFIX = $(ORG_IDENTIFIER) PRODUCT_NAME = SideStore -PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).$(PRODUCT_NAME) +PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).SideStore // add team ID to bundle ID for debug builds since these will most likely be installed via Xcode // SideStore will expect the team ID to be at the end of the bundle ID, but this doesn't happen when we install via Xcode // we don't want to do this for release since those builds will most likely be installed via SideServer, which adds the team ID diff --git a/Makefile b/Makefile index 3163b86c..20d98963 100644 --- a/Makefile +++ b/Makefile @@ -156,6 +156,17 @@ test: ## -- Building -- +enable_unstable: + echo >> ./Build.xcconfig + echo 'SWIFT_ACTIVE_COMPILATION_CONDITIONS = $$(inherited) UNSTABLE' >> ./Build.xcconfig + +enable_mdc: + echo >> ./Build.xcconfig + echo 'SWIFT_ACTIVE_COMPILATION_CONDITIONS = $$(inherited) MDC' >> ./Build.xcconfig + echo 'GCC_PREPROCESSOR_DEFINITIONS = $$(inherited) MDC=1' >> ./Build.xcconfig + +DSYM_FOLDER ?= ./dSYM + build: @xcodebuild -project AltStore.xcodeproj \ -scheme AltStore \ @@ -166,15 +177,18 @@ build: CODE_SIGNING_ALLOWED=NO \ DEVELOPMENT_TEAM=XYZ0123456 \ ORG_IDENTIFIER=com.SideStore \ - DWARF_DSYM_FOLDER_PATH="." + DWARF_DSYM_FOLDER_PATH="$(DSYM_FOLDER)" fakesign: rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ ldid -SAltStore/Resources/ReleaseEntitlements.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore -ipa: - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload +IPA_NAME ?= SideStore.ipa +ipa: + mkdir -p Payload/SideStore.app + cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ + zip -r $(IPA_NAME) Payload + +clean: + rm -rf archive.xcarchive Payload