From 173c585f2d319417d6395d4e9dbf8a8e1799fc4d Mon Sep 17 00:00:00 2001 From: naturecodevoid <44983869+naturecodevoid@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:23:12 -0800 Subject: [PATCH] cleanup actions, revamp beta action, modify nightly build num system to be day specific --- .github/workflows/beta.yml | 47 +++++++------------ .../workflows/increase-nightly-build-num.sh | 28 +++++++++++ .github/workflows/nightly.yml | 32 +++++-------- .github/workflows/pr.yml | 22 ++------- .github/workflows/stable.yml | 29 ++++-------- .gitignore | 1 + 6 files changed, 67 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/increase-nightly-build-num.sh diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index ff068d43..ec7ab82e 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -1,16 +1,12 @@ name: Beta SideStore build on: push: - branches: - - develop + tags: + - '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' # example: 1.0.0-beta.1 jobs: build: name: Build and upload SideStore Beta - if: startsWith(github.event.head_commit.message, '[beta]') - concurrency: - group: ${{ github.ref }} - cancel-in-progress: true strategy: fail-fast: false matrix: @@ -28,8 +24,8 @@ jobs: - name: Install dependencies run: brew install ldid - - name: Add beta suffix to version - run: sed -e '/MARKETING_VERSION = .*/s/$/-beta.${{ github.run_number }}/' -i '' Build.xcconfig + - name: Change version to tag + run: sed -e '/MARKETING_VERSION = .*/s/= .*/= ${{ github.ref_name }}/' -i '' Build.xcconfig - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 @@ -37,29 +33,13 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - name: Upload Artifact uses: actions/upload-artifact@v3.1.0 @@ -79,12 +59,13 @@ jobs: id: date_altstore run: echo "date=$(date -u +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Upload to beta release - uses: IsaacShelton/update-existing-release@v1.3.1 + - name: Upload to new beta release + uses: softprops/action-gh-release@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - release: "Beta" - tag: "beta" + name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref_name }} + draft: true prerelease: true files: SideStore.ipa body: | @@ -95,6 +76,10 @@ jobs: If you want to be on the bleeding edge and use the latest development builds, you can look at [SideStore Nightly](https://github.com/${{ github.repository }}/releases/tag/nightly). **Please be aware that these builds have a much higher chance of bugs than beta or stable**. If you use the `SideStore (Beta)` app, it will use the latest beta build (make sure to update it in "My Apps"). + + ## Changelog + + - TODO ## Build Info diff --git a/.github/workflows/increase-nightly-build-num.sh b/.github/workflows/increase-nightly-build-num.sh new file mode 100644 index 00000000..4be78710 --- /dev/null +++ b/.github/workflows/increase-nightly-build-num.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Ensure we are in root directory +cd "$(dirname "$0")/../.." + +DATE=`date -u +'%Y.%m.%d'` +BUILD_NUM=1 + +write() { + sed -e "/MARKETING_VERSION = .*/s/$/-nightly.$DATE.$BUILD_NUM/" -i '' Build.xcconfig + echo "$DATE,$BUILD_NUM" > .nightly-build-num +} + +if [ ! -f ".nightly-build-num" ]; then + write + exit 0 +fi + +LAST_DATE=`cat .nightly-build-num | perl -n -e '/([^,]*),([^ ]*)$/ && print $1'` +LAST_BUILD_NUM=`cat .nightly-build-num | perl -n -e '/([^,]*),([^ ]*)$/ && print $2'` + +if [[ "$DATE" != "$LAST_DATE" ]]; then + write +else + BUILD_NUM=`expr $LAST_BUILD_NUM + 1` + write +fi + diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 705156ca..03436493 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -27,8 +27,14 @@ jobs: - name: Install dependencies run: brew install ldid - - name: Add nightly suffix to version - run: sed -e '/MARKETING_VERSION = .*/s/$/-nightly.${{ github.run_number }}/' -i '' Build.xcconfig + - name: Cache .nightly-build-num + uses: actions/cache@v3 + with: + path: .nightly-build-num + key: nightly-build-num + + - name: Increase nightly build number and set as version + run: bash .github/workflows/increase-nightly-build-num.sh - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 @@ -36,29 +42,13 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - name: Upload Artifact uses: actions/upload-artifact@v3.1.0 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2de7ed2f..580b769b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -31,29 +31,13 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - name: Upload Artifact uses: actions/upload-artifact@v3.1.0 diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 8989ab88..2ee72e04 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -2,7 +2,7 @@ name: Stable SideStore build on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+*' + - '[0-9]+.[0-9]+.[0-9]+' # example: 1.0.0 jobs: build: @@ -24,35 +24,22 @@ jobs: - name: Install dependencies run: brew install ldid + - name: Change version to tag + run: sed -e '/MARKETING_VERSION = .*/s/= .*/= ${{ github.ref_name }}/' -i '' Build.xcconfig + - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 with: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - name: Upload Artifact uses: actions/upload-artifact@v3.1.0 @@ -77,7 +64,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} name: ${{ steps.version.outputs.version }} - tag_name: ${{ github.ref }} + tag_name: ${{ github.ref_name }} draft: true files: SideStore.ipa body: | diff --git a/.gitignore b/.gitignore index 5292f2a9..a6dec00c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ Dependencies/.*-prebuilt-fetch-* Dependencies/minimuxer/* Dependencies/em_proxy/* !Dependencies/**/.gitkeep +.nightly-build-num