mirror of
https://github.com/yattee/yattee.git
synced 2026-05-01 21:17:49 +00:00
Retry SPM dependency resolve to work around binary-target race
xcodebuild's resolvePackageDependencies sometimes fails with "already exists in file system" when multiple binary xcframework targets from the same release URL try to extract concurrently. The failing target varies across runs, confirming a race, not a missing-file problem. Wipe the three SPM cache roots between attempts and retry up to three times before giving up; once the resolve succeeds, fastlane's own resolve step reuses the cache.
This commit is contained in:
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
@@ -46,11 +46,25 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo xcodebuild -downloadPlatform iOS || true
|
sudo xcodebuild -downloadPlatform iOS || true
|
||||||
sudo xcodebuild -downloadPlatform tvOS || true
|
sudo xcodebuild -downloadPlatform tvOS || true
|
||||||
- name: Clear SPM cache
|
- name: Resolve SPM dependencies (retry around SPM binary-target race)
|
||||||
run: |
|
run: |
|
||||||
rm -rf ~/Library/Caches/org.swift.swiftpm
|
case "${{ matrix.lane }}" in
|
||||||
rm -rf ~/Library/org.swift.swiftpm
|
"ios beta") SCHEME="Yattee (iOS)" ;;
|
||||||
rm -rf ~/Library/Developer/Xcode/DerivedData
|
"tvos beta") SCHEME="Yattee (tvOS)" ;;
|
||||||
|
*) SCHEME="Yattee (iOS)" ;;
|
||||||
|
esac
|
||||||
|
set +e
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
rm -rf ~/Library/Caches/org.swift.swiftpm ~/Library/org.swift.swiftpm ~/Library/Developer/Xcode/DerivedData
|
||||||
|
echo "::group::Resolve attempt $attempt for $SCHEME"
|
||||||
|
xcodebuild -resolvePackageDependencies -project Yattee.xcodeproj -scheme "$SCHEME"
|
||||||
|
RC=$?
|
||||||
|
echo "::endgroup::"
|
||||||
|
[ $RC -eq 0 ] && exit 0
|
||||||
|
echo "Attempt $attempt failed (rc=$RC), retrying after 15s..."
|
||||||
|
sleep 15
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
- uses: maierj/fastlane-action@v3.0.0
|
- uses: maierj/fastlane-action@v3.0.0
|
||||||
with:
|
with:
|
||||||
lane: ${{ matrix.lane }}
|
lane: ${{ matrix.lane }}
|
||||||
@@ -76,11 +90,20 @@ jobs:
|
|||||||
- uses: maxim-lobanov/setup-xcode@v1
|
- uses: maxim-lobanov/setup-xcode@v1
|
||||||
with:
|
with:
|
||||||
xcode-version: '26.0.1'
|
xcode-version: '26.0.1'
|
||||||
- name: Clear SPM cache
|
- name: Resolve SPM dependencies (retry around SPM binary-target race)
|
||||||
run: |
|
run: |
|
||||||
rm -rf ~/Library/Caches/org.swift.swiftpm
|
set +e
|
||||||
rm -rf ~/Library/org.swift.swiftpm
|
for attempt in 1 2 3; do
|
||||||
rm -rf ~/Library/Developer/Xcode/DerivedData
|
rm -rf ~/Library/Caches/org.swift.swiftpm ~/Library/org.swift.swiftpm ~/Library/Developer/Xcode/DerivedData
|
||||||
|
echo "::group::Resolve attempt $attempt for Yattee (macOS)"
|
||||||
|
xcodebuild -resolvePackageDependencies -project Yattee.xcodeproj -scheme "Yattee (macOS)"
|
||||||
|
RC=$?
|
||||||
|
echo "::endgroup::"
|
||||||
|
[ $RC -eq 0 ] && exit 0
|
||||||
|
echo "Attempt $attempt failed (rc=$RC), retrying after 15s..."
|
||||||
|
sleep 15
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
- uses: maierj/fastlane-action@v3.0.0
|
- uses: maierj/fastlane-action@v3.0.0
|
||||||
with:
|
with:
|
||||||
lane: mac build_and_notarize
|
lane: mac build_and_notarize
|
||||||
|
|||||||
Reference in New Issue
Block a user