@@ -41,24 +41,41 @@ jobs:
41
41
42
42
- name : Ensure Cocoapods repo has been updated
43
43
run : |
44
- # If the new version is simply vX.Y.Z, wait up to an hour for its podspec to be present.
45
- if [[ "$GITHUB_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
46
- echo "Checking Cocoapods repo for associated Firebase ${GITHUB_REF:1} podspec."
47
- podspec_url="https://github.com/CocoaPods/Specs/blob/master/Specs/0/3/5/Firebase/${GITHUB_REF:1}/Firebase.podspec.json"
44
+ # If the new version is simply vX.Y.Z or X.Y.Z, wait up to an hour each for its podspec and prebuilt zip file to be present.
45
+ if [[ "$GITHUB_REF" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
46
+ version=$(echo "$GITHUB_REF" | sed s/^v//) # remove leading v if present
47
+ echo "Checking Cocoapods repo for associated Firebase ${version} podspec."
48
+ podspec_url="https://github.com/CocoaPods/Specs/blob/master/Specs/0/3/5/Firebase/${version}/Firebase.podspec.json"
48
49
for retry in {1..12} error; do
49
50
# Check every 5 minutes, up to an hour, for the new podspec to be present.
50
51
# If it's still not present, trigger the update anyway.
51
52
if [[ $retry == "error" ]]; then
52
- echo "::warning ::Firebase ${GITHUB_REF:1 } podspec not found, updating anyway."
53
+ echo "::warning ::Firebase ${version } podspec not found, updating anyway."
53
54
exit 0
54
55
fi
55
56
echo -n "Check ${podspec_url} (attempt ${retry}) ..."
56
- curl -L -f -o /dev/null "${podspec_url}" 2> /dev/null && echo " success!" && break
57
+ curl -H 'Authorization: token ${{ github.token }}' -L -f -o /dev/null "${podspec_url}" 2> /dev/null && echo " success!" && break
58
+ echo " failed."
59
+ sleep 300
60
+ done
61
+ echo "Checking firebase-ios-sdk repo for ${version} prebuilt zip."
62
+ # Check for the zip file on this actual release URL (which might include the leading v)
63
+ zipfile_url="https://github.com/firebase/firebase-ios-sdk/releases/download/${GITHUB_REF}/Firebase.zip"
64
+ for retry in {1..12} error; do
65
+ # Check every 5 minutes, up to an hour, for the new zip file to be present.
66
+ # If it's still not present, trigger the update anyway.
67
+ if [[ $retry == "error" ]]; then
68
+ echo "::warning ::Firebase ${version} zip file not found, updating anyway."
69
+ exit 0
70
+ fi
71
+ echo -n "Check ${zipfile_url} (attempt ${retry}) ..."
72
+ # curl's "-r 0-0" option means only download the first byte, this prevents us from downloading 300+ MB.
73
+ curl -H 'Authorization: token ${{ github.token }}' -L -f -o /dev/null -r 0-0 "${zipfile_url}" 2> /dev/null && echo " success!" && break
57
74
echo " failed."
58
75
sleep 300
59
76
done
60
77
else
61
- echo "Tag '$GITHUB_REF' doesn't match the 'vX.Y.Z' format, skipping Cocoapods repo check."
78
+ echo "Tag '$GITHUB_REF' doesn't match the 'vX.Y.Z' or 'X.Y.Z' format, skipping Cocoapods repo and release zip check."
62
79
fi
63
80
64
81
- name : Trigger firebase-cpp-sdk update
0 commit comments