Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit f0fca4f

Browse files
authored
Add back missing signer enum in signer.swift
1 parent 487a90b commit f0fca4f

File tree

2 files changed

+86
-15
lines changed

2 files changed

+86
-15
lines changed

.github/workflows/compileCheck.yml

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,66 @@ name: Compile Check
22

33
on:
44
push:
5-
branches: [ "dev" ]
5+
branches: ["dev"]
66

77
jobs:
88
compile:
99
runs-on: macos-latest
10-
1110
steps:
1211
- uses: actions/checkout@v4
1312

14-
# 1. Install XcodeGen
15-
- name: Install XcodeGen
16-
run: brew install xcodegen
13+
- name: Install Homebrew (if missing) & deps
14+
run: |
15+
# ensure brew exists (CI image usually has it) and install xcodegen
16+
which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
17+
brew update || true
18+
brew install xcodegen || true
1719
18-
# 2. Generate the Xcode project
1920
- name: Generate Xcode Project
2021
run: xcodegen generate
2122

22-
# 3. Cache SwiftPM package builds (SUPER IMPORTANT)
23+
- name: Resolve Swift Package dependencies (for Xcode/SPM)
24+
run: |
25+
# Resolve / download SPM packages so resources are available for the project
26+
if [ -f "./prostore.xcodeproj/project.pbxproj" ]; then
27+
xcodebuild -resolvePackageDependencies -project ./prostore.xcodeproj
28+
else
29+
echo "No prostore.xcodeproj found — check xcodegen output"
30+
ls -la
31+
fi
32+
2333
- uses: actions/cache@v4
2434
with:
2535
path: |
2636
~/Library/Developer/Xcode/DerivedData
2737
.build
28-
key: swiftpm-${{ hashFiles('project.yml') }}
38+
.swiftpm
39+
key: swiftpm-${{ runner.os }}-${{ hashFiles('project.yml') }}
2940
restore-keys: |
30-
swiftpm-
41+
swiftpm-${{ runner.os }}-
42+
43+
- name: Diagnostic: look for ZIPFoundation resources
44+
run: |
45+
echo "---- Searching repo for ZIPFoundation_ZIPFoundation.bundle references ----"
46+
git grep -n "ZIPFoundation_ZIPFoundation.bundle" || true
47+
echo "---- Searching filesystem for ZIPFoundation* ----"
48+
find . -iname "ZIPFoundation*" -maxdepth 6 -print || true
49+
echo "---- List project resources for quick debug ----"
50+
if [ -f "./prostore.xcodeproj/project.pbxproj" ]; then
51+
grep -n "ZIPFoundation" ./prostore.xcodeproj/project.pbxproj || true
52+
fi
3153
32-
# 4. Compile check ONLY (real build, no archive, fast)
33-
- name: Compile Check (Cached)
54+
- name: Compile Check (cached, fast)
3455
run: |
56+
# Fast build to validate compile & package resolution — code signing disabled for CI
3557
xcodebuild \
58+
-project prostore.xcodeproj \
3659
-scheme prostore \
37-
-destination "platform=iOS Simulator,name=iPad (10th generation),OS=18.6" \
60+
-destination 'platform=iOS Simulator,name=iPad (10th generation),OS=18.6' \
3861
-configuration Debug \
39-
BUILD_DIR=$(pwd)/build \
40-
ONLY_ACTIVE_ARCH=YES
62+
-derivedDataPath $(pwd)/build \
63+
ONLY_ACTIVE_ARCH=YES \
64+
COMPILER_INDEX_STORE_ENABLE=NO \
65+
ENABLE_PREVIEWS=NO \
66+
CODE_SIGNING_ALLOWED=NO \
67+
build | xcpretty || true

Sources/prostore/signer.swift

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,51 @@ import Foundation
22
import ZIPFoundation
33
import ZsignSwift
44

5-
5+
public enum signer {
6+
public static func sign(
7+
ipaURL: URL,
8+
p12URL: URL,
9+
provURL: URL,
10+
p12Password: String,
11+
progressUpdate: @escaping (String) -> Void = { _ in },
12+
completion: @escaping (Result<URL, Error>) -> Void
13+
) {
14+
SigningManager.sign(
15+
ipaURL: ipaURL,
16+
p12URL: p12URL,
17+
provURL: provURL,
18+
p12Password: p12Password,
19+
progressUpdate: progressUpdate,
20+
completion: completion
21+
)
22+
}
23+
24+
public static func getExpirationDate(provURL: URL) -> Date? {
25+
guard let data = try? Data(contentsOf: provURL) else { return nil }
26+
return getExpirationDate(provData: data)
27+
}
28+
29+
public static func getExpirationDate(provData: Data) -> Date? {
30+
let startTag = Data("<plist".utf8)
31+
let endTag = Data("</plist>".utf8)
32+
33+
guard let startRange = provData.range(of: startTag),
34+
let endRange = provData.range(of: endTag) else {
35+
return nil
36+
}
37+
38+
let plistDataSlice = provData[startRange.lowerBound..<endRange.upperBound]
39+
let plistData = Data(plistDataSlice)
40+
41+
guard let parsed = try? PropertyListSerialization.propertyList(from: plistData, options: [], format: nil),
42+
let dict = parsed as? [String: Any],
43+
let expDate = dict["ExpirationDate"] as? Date else {
44+
return nil
45+
}
46+
47+
return expDate
48+
}
49+
}
650

751
fileprivate class SigningManager {
852
static func sign(

0 commit comments

Comments
 (0)