11# CF Cache Status - Build & Release Commands
22# Usage: just <command>
33
4- # Load environment from .env if it exists
54set dotenv-load
65
7- # Configuration
8- app_name := " CF Cache Status"
96project := " CF Cache Status/CF Cache Status.xcodeproj"
107scheme := " CF Cache Status"
118build_dir := " build"
12- archive_path := build_dir / " CacheStatus.xcarchive"
13- export_path := build_dir / " export"
14- app_path := export_path / " CF Cache Status.app"
15- zip_path := build_dir / " CacheStatus.zip"
169
17- # Default recipe
1810default :
1911 @ just --list
2012
13+ # Show current version from git
14+ version :
15+ @ git describe --tags --always 2 >/ dev/ null || echo " untagged"
16+
2117# Run CDN detection tests
2218test :
2319 node tests/ cdn-detection.test.js
@@ -28,23 +24,13 @@ test:
2824
2925# Build for development (unsigned)
3026build-dev :
31- xcodebuild -project " {{ project}} " \
32- - scheme " {{ scheme}} " \
33- - configuration Debug \
34- build \
35- CODE_SIGN_IDENTITY=" -" \
36- CODE_SIGNING_REQUIRED=NO
27+ xcodebuild -project " {{ project}} " -scheme " {{ scheme}} " -configuration Debug build CODE_SIGN_IDENTITY=" -" CODE_SIGNING_REQUIRED=NO
3728
3829# Build release (unsigned, for testing)
3930build-release :
40- xcodebuild -project " {{ project}} " \
41- - scheme " {{ scheme}} " \
42- - configuration Release \
43- build \
44- CODE_SIGN_IDENTITY=" -" \
45- CODE_SIGNING_REQUIRED=NO
46-
47- # Clean Xcode build artifacts
31+ xcodebuild -project " {{ project}} " -scheme " {{ scheme}} " -configuration Release build CODE_SIGN_IDENTITY=" -" CODE_SIGNING_REQUIRED=NO
32+
33+ # Clean build artifacts
4834clean :
4935 rm -rf " {{ build_dir}} "
5036 xcodebuild -project " {{ project}} " -scheme " {{ scheme}} " clean
@@ -54,168 +40,55 @@ xcode:
5440 open " {{ project}} "
5541
5642# =============================================================================
57- # Release (requires APPLE_ID, APPLE_TEAM_ID, APPLE_APP_PASSWORD)
43+ # Release (requires APPLE_ID, APPLE_TEAM_ID, APPLE_APP_PASSWORD in .env )
5844# =============================================================================
5945
60- # Build, sign, and archive for distribution
61- archive :
62- #!/usr/bin/env bash
63- set -e
64- mkdir -p " {{ build_dir}} "
65-
66- xcodebuild archive \
67- - project " {{ project}} " \
68- - scheme " {{ scheme}} " \
69- - archivePath " {{ archive_path}} " \
70- DEVELOPMENT_TEAM=" $APPLE_TEAM_ID" \
71- CODE_SIGN_STYLE=Manual \
72- CODE_SIGN_IDENTITY=" Developer ID Application"
73-
74- cat > " {{ build_dir}} /ExportOptions.plist" << EOF
75- <?xml version=" 1.0" encoding=" UTF-8" ?>
76- <!DOCTYPE plist PUBLIC " -//Apple//DTD PLIST 1.0//EN" " http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
77- <plist version=" 1.0" >
78- <dict>
79- <key>method</ key>
80- <string>developer-id</ string>
81- <key>teamID</ key>
82- <string>$APPLE_TEAM_ID</ string>
83- </ dict>
84- </ plist>
85- EOF
86-
87- xcodebuild -exportArchive \
88- - archivePath " {{ archive_path}} " \
89- - exportPath " {{ export_path}} " \
90- - exportOptionsPlist " {{ build_dir}} /ExportOptions.plist"
91-
92- echo " ✓ Archive complete: {{ app_path}} "
93-
94- # Submit app for notarization
95- submit : _check-env
96- #!/usr/bin/env bash
97- set -e
98-
99- if [[ ! -d " {{ app_path}} " ]]; then
100- echo " Error: App not found. Run 'just archive' first."
101- exit 1
102- fi
46+ # Build and sign for distribution (optionally specify a tag)
47+ archive tag = " ":
48+ ./ scripts/ archive.sh {{ tag}}
10349
104- echo " Creating zip..."
105- ditto -c -k --keepParent " {{ app_path}} " " {{ zip_path}} "
106-
107- echo " Submitting for notarization..."
108- output=$(xcrun notarytool submit " {{ zip_path}} " \
109- --apple-id " $APPLE_ID" \
110- --team-id " $APPLE_TEAM_ID" \
111- --password " $APPLE_APP_PASSWORD" \
112- --output-format json)
113-
114- submission_id=$(echo " $output" | grep -o ' "id":"[^"]*"' | head -1 | cut -d' "' -f4)
115- echo " $submission_id" > " {{ build_dir}} /.submission_id"
116-
117- echo " ✓ Submitted: $submission_id"
118- echo " "
119- echo " Check status: just status"
50+ # Submit for notarization
51+ submit version = " ":
52+ ./ scripts/ submit.sh {{ version}}
12053
12154# Check notarization status
122- status id = " ": _check-env
55+ status id = " ":
12356 #!/usr/bin/env bash
12457 submission_id=" {{ id}} "
125- [[ -z " $submission_id" ]] && submission_id=$(cat " {{ build_dir}} /.submission_id" 2 >/ dev/ null)
58+ [[ -z " $submission_id" && -f " {{ build_dir}} /.current_version" ]] && \
59+ submission_id=$(cat " {{ build_dir}} /$(cat {{ build_dir}} /.current_version)/.submission_id" 2 >/ dev/ null)
60+ [[ -z " $submission_id" ]] && { echo " No submission ID" ; exit 1 ; }
61+ xcrun notarytool info " $submission_id" --apple-id " $APPLE_ID" --team-id " $APPLE_TEAM_ID" --password " $APPLE_APP_PASSWORD"
12662
127- if [[ -z " $submission_id" ]]; then
128- echo " Error: No submission ID. Provide one or run 'just submit' first."
129- exit 1
130- fi
131-
132- xcrun notarytool info " $submission_id" \
133- - -apple-id " $APPLE_ID" \
134- - -team-id " $APPLE_TEAM_ID" \
135- - -password " $APPLE_APP_PASSWORD"
136-
137- # Wait for notarization to complete
138- wait id = " ": _check-env
63+ # Wait for notarization
64+ wait id = " ":
13965 #!/usr/bin/env bash
14066 submission_id=" {{ id}} "
141- [[ -z " $submission_id" ]] && submission_id=$(cat " {{ build_dir}} /.submission_id" 2 >/ dev/ null)
67+ [[ -z " $submission_id" && -f " {{ build_dir}} /.current_version" ]] && \
68+ submission_id=$(cat " {{ build_dir}} /$(cat {{ build_dir}} /.current_version)/.submission_id" 2 >/ dev/ null)
69+ xcrun notarytool wait " $submission_id" --apple-id " $APPLE_ID" --team-id " $APPLE_TEAM_ID" --password " $APPLE_APP_PASSWORD"
14270
143- xcrun notarytool wait " $submission_id" \
144- - -apple-id " $APPLE_ID" \
145- - -team-id " $APPLE_TEAM_ID" \
146- - -password " $APPLE_APP_PASSWORD"
71+ # Staple ticket and create final zip
72+ staple version = " ":
73+ ./ scripts/ staple.sh {{ version}}
14774
148- # Staple notarization ticket and create release zip
149- staple :
75+ # Full release pipeline: archive, submit, wait, staple
76+ release tag = " " :
15077 #!/usr/bin/env bash
15178 set -e
152-
153- if [[ ! -d " {{ app_path}} " ]]; then
154- echo " Error: App not found at {{ app_path}} "
155- exit 1
156- fi
157-
158- echo " Stapling ticket..."
159- xcrun stapler staple " {{ app_path}} "
160-
161- echo " Creating release zip..."
162- rm -f " {{ zip_path}} "
163- ditto -c -k --keepParent " {{ app_path}} " " {{ zip_path}} "
164-
165- echo " ✓ Release ready: {{ zip_path}} "
166-
167- # Full release: archive, submit, wait, staple
168- release : _check-env archive
169- #!/usr/bin/env bash
170- set -e
171-
172- echo " Creating zip..."
173- ditto -c -k --keepParent " {{ app_path}} " " {{ zip_path}} "
174-
175- echo " Submitting for notarization..."
176- xcrun notarytool submit " {{ zip_path}} " \
177- - -apple-id " $APPLE_ID" \
178- - -team-id " $APPLE_TEAM_ID" \
179- - -password " $APPLE_APP_PASSWORD" \
180- - -wait
181-
79+ just archive {{ tag}}
80+ just submit
81+ just wait
18282 just staple
183- echo " ✓ Release complete!"
18483
18584# Show notarization history
186- history : _check-env
187- xcrun notarytool history \
188- - -apple-id " $APPLE_ID" \
189- - -team-id " $APPLE_TEAM_ID" \
190- - -password " $APPLE_APP_PASSWORD"
191-
192- # Get notarization log for a submission
193- log id : _check-env
194- xcrun notarytool log " {{ id}} " \
195- - -apple-id " $APPLE_ID" \
196- - -team-id " $APPLE_TEAM_ID" \
197- - -password " $APPLE_APP_PASSWORD"
85+ history :
86+ xcrun notarytool history --apple-id " $APPLE_ID" --team-id " $APPLE_TEAM_ID" --password " $APPLE_APP_PASSWORD"
19887
199- # =============================================================================
200- # Helpers
201- # =============================================================================
88+ # Get notarization log
89+ log id :
90+ xcrun notarytool log {{ id }} --apple-id " $APPLE_ID" --team-id " $APPLE_TEAM_ID" --password " $APPLE_APP_PASSWORD"
20291
203- # Verify required environment variables
204- [private ]
205- _ check-env :
206- #!/usr/bin/env bash
207- missing=0
208- for var in APPLE_ID APPLE_TEAM_ID APPLE_APP_PASSWORD; do
209- if [[ -z " ${!var}" ]]; then
210- echo " Missing: $var"
211- missing=1
212- fi
213- done
214- if [[ $missing -eq 1 ]]; then
215- echo " "
216- echo " Set these in .env or export them:"
217- echo " APPLE_ID=your@email.com"
218- echo " APPLE_TEAM_ID=XXXXXXXXXX"
219- echo " APPLE_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx"
220- exit 1
221- fi
92+ # List available builds
93+ builds :
94+ @ ls -d {{ build_dir}} / v* {{ build_dir}} / dev 2 >/ dev/ null | xargs -I{} basename {} | sort -V || echo " (none)"
0 commit comments