@@ -132,8 +132,42 @@ jobs:
132132 npm ci
133133 npm run build:mobile -- --no-progress
134134 npx cap sync ios
135+
136+ # The cloned packages and their binary artifacts are ~250MB of prebuilt
137+ # xcframeworks. Restore and save are split rather than using actions/cache,
138+ # which only saves when the whole job succeeds - the cache should persist even
139+ # if the build step later fails.
140+ - name : Restore Swift package cache
141+ id : spm-cache
142+ uses : actions/cache/restore@v4
143+ with :
144+ path : IsraelHiking.Web/ios/.spm-cache
145+ key : spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
146+ restore-keys : spm-${{ runner.os }}-
147+
148+ # Resolve up front. Left to fastlane, this download happens inside
149+ # xcodebuild -showBuildSettings, whose output fastlane captures - so it is
150+ # invisible and trips the build-settings timeout. Must run after `npm ci`, since
151+ # the plugin packages are path references into node_modules.
152+ - name : Resolve Swift packages
153+ timeout-minutes : 20
154+ run : |
155+ cd IsraelHiking.Web/ios/App
156+ time xcodebuild -resolvePackageDependencies \
157+ -project App.xcodeproj \
158+ -clonedSourcePackagesDirPath ../.spm-cache
159+ du -sh ../.spm-cache ../.spm-cache/artifacts
160+
161+ - name : Save Swift package cache
162+ if : steps.spm-cache.outputs.cache-hit != 'true'
163+ uses : actions/cache/save@v4
164+ with :
165+ path : IsraelHiking.Web/ios/.spm-cache
166+ key : spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
167+
135168 - name : Build iOS with signing
136169 if : ${{ github.secret_source == 'Actions' }}
170+ timeout-minutes : 25
137171 run : |
138172 cd IsraelHiking.Web/ios/App
139173 bundle exec fastlane build_ios
0 commit comments