[Beta-Suuport]: Added commit ID appending to version if in beta track build

This commit is contained in:
Magesh K
2024-12-17 17:00:53 +05:30
parent c41d25c19b
commit adee94819a
3 changed files with 36 additions and 2 deletions

View File

@@ -83,6 +83,13 @@ final class VerifyAppOperation: ResultOperation<Void>
{
guard let ipaURL = self.context.ipaURL else { throw OperationError.appNotFound(name: app.name) }
// TODO: @mahee96: appVersion is instantiated source info as AppVersion incoming from source json
// app is the instantiated ipa downloaded from the specified in the source json in temp dir
//
// For alpha and beta/nightly releases, the CFBundleShortVersionString which is the
// $(MARKETING_VERSION) will be overriden with the commit id before invoking xcode build
//
try await self.verifyHash(of: app, at: ipaURL, matches: appVersion)
try await self.verifyDownloadedVersion(of: app, matches: appVersion)
try await self.verifyPermissions(of: app, match: appVersion)

View File

@@ -46,6 +46,7 @@ public class AppVersion: NSManagedObject, Decodable, Fetchable
@NSManaged public var appBundleID: String
@NSManaged public var sourceID: String?
@NSManaged public var isBeta: Bool
/* Relationships */
@NSManaged public private(set) var app: StoreApp?
@@ -67,6 +68,7 @@ public class AppVersion: NSManagedObject, Decodable, Fetchable
case sha256
case minOSVersion
case maxOSVersion
case isBeta
}
public required init(from decoder: Decoder) throws

View File

@@ -156,7 +156,31 @@ test:
## -- Building --
build:
# Fetch the latest commit ID if IS_BETA is defined
fetch_commit_id:
@echo ""
@if [ -n "$$IS_BETA" ]; then \
echo "'IS_BETA' is defined. Fetching the latest commit ID from HEAD..."; \
export COMMIT_ID=$$(git rev-parse --short HEAD); \
echo "Commit ID: $$COMMIT_ID"; \
else \
echo "'IS_BETA' is not defined. Skipping commit ID fetch."; \
fi
@echo ""
# Print release type based on the presence of COMMIT_ID
print_release_type:
@if [ -z "$$COMMIT_ID" ]; then \
echo ">>>>>>>> This is STABLE release <<<<<<<<<"; \
echo " Using default MARKETING_VERSION from project.pbxproj."; \
else \
echo ">>>>>>>> This is ALPHA/BETA release for commitID = $$COMMIT_ID <<<<<<<<<"; \
echo " Building with MARKETING_VERSION=$$COMMIT_ID"; \
fi
@echo ""
# Build target with the fetch_commit_id dependency
build: fetch_commit_id print_release_type
@xcodebuild -workspace AltStore.xcworkspace \
-scheme SideStore \
-sdk iphoneos \
@@ -166,7 +190,8 @@ build:
CODE_SIGNING_ALLOWED=NO \
DEVELOPMENT_TEAM=XYZ0123456 \
ORG_IDENTIFIER=com.SideStore \
DWARF_DSYM_FOLDER_PATH="."
DWARF_DSYM_FOLDER_PATH="." \
MARKETING_VERSION=$$COMMIT_ID
fakesign:
rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/