Skip to content

Commit b7fc899

Browse files
authored
Update release workflow (#6481)
1 parent 47fcf14 commit b7fc899

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Update SpecsTesting repo setup
3232
run: |
3333
ossbotaccess=`cat oss-bot-access.txt`
34-
BOT_TOKEN="${ossbotaccess}" nightly_test_version="${nightly_version}" scripts/release_testing_setup.sh
34+
BOT_TOKEN="${ossbotaccess}" test_version="${nightly_version}" scripts/release_testing_setup.sh nightly_testing
3535
- name: Update SpecsTesting repo
3636
run: |
3737
botaccess=`cat bot-access.txt`
@@ -44,7 +44,6 @@ jobs:
4444
run: |
4545
pod repo remove "${local_repo}"
4646
rm -rf bot-access.txt
47-
4847
remoteconfig_quickstart:
4948
# Don't run on private repo unless it is a PR.
5049
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
@@ -62,7 +61,7 @@ jobs:
6261
- name: Setup testing repo and quickstart
6362
run: |
6463
botaccess=`cat bot-access.txt`
65-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh config release_testing
64+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh config nightly_release_testing
6665
- name: Install Secret GoogleService-Info.plist
6766
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
6867
quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
@@ -96,7 +95,7 @@ jobs:
9695
- name: Setup testing repo and quickstart
9796
run: |
9897
botaccess=`cat bot-access.txt`
99-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh abtesting release_testing
98+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh abtesting nightly_release_testing
10099
- name: Install Secret GoogleService-Info.plist
101100
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
102101
quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
@@ -130,7 +129,7 @@ jobs:
130129
- name: Setup testing repo and quickstart
131130
run: |
132131
botaccess=`cat bot-access.txt`
133-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Authentication release_testing
132+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Authentication nightly_release_testing
134133
- name: Install Secret GoogleService-Info.plist
135134
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
136135
quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
@@ -166,7 +165,7 @@ jobs:
166165
- name: Setup testing repo and quickstart
167166
run: |
168167
botaccess=`cat bot-access.txt`
169-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Crashlytics release_testing
168+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Crashlytics nightly_release_testing
170169
- name: Install Secret GoogleService-Info.plist
171170
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-crashlytics.plist.gpg \
172171
quickstart-ios/crashlytics/GoogleService-Info.plist "$plist_secret"
@@ -209,7 +208,7 @@ jobs:
209208
- name: Setup testing repo and quickstart
210209
run: |
211210
botaccess=`cat bot-access.txt`
212-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh database release_testing
211+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh database nightly_release_testing
213212
- name: Install Secret GoogleService-Info.plist
214213
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
215214
quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
@@ -247,7 +246,7 @@ jobs:
247246
- name: Setup testing repo and quickstart
248247
run: |
249248
botaccess=`cat bot-access.txt`
250-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh dynamiclinks release_testing
249+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh dynamiclinks nightly_release_testing
251250
- name: Install Secret GoogleService-Info.plist
252251
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-dynamiclinks.plist.gpg \
253252
quickstart-ios/dynamiclinks/GoogleService-Info.plist "$plist_secret"
@@ -291,7 +290,7 @@ jobs:
291290
- name: Setup testing repo and quickstart
292291
run: |
293292
botaccess=`cat bot-access.txt`
294-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh firestore release_testing
293+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh firestore nightly_release_testing
295294
- name: Install Secret GoogleService-Info.plist
296295
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
297296
quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
@@ -328,7 +327,7 @@ jobs:
328327
- name: Setup testing repo and quickstart
329328
run: |
330329
botaccess=`cat bot-access.txt`
331-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh functions release_testing
330+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh functions nightly_release_testing
332331
- name: install secret googleservice-info.plist
333332
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
334333
quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
@@ -370,7 +369,7 @@ jobs:
370369
- name: Setup testing repo and quickstart
371370
run: |
372371
botaccess=`cat bot-access.txt`
373-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh inappmessaging release_testing
372+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh inappmessaging nightly_release_testing
374373
- name: install secret googleservice-info.plist
375374
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-inappmessaging.plist.gpg \
376375
quickstart-ios/inappmessaging/GoogleService-Info.plist "$plist_secret"
@@ -410,7 +409,7 @@ jobs:
410409
- name: Setup testing repo and quickstart
411410
run: |
412411
botaccess=`cat bot-access.txt`
413-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh messaging release_testing
412+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh messaging nightly_release_testing
414413
- name: Install Secret GoogleService-Info.plist
415414
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
416415
quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
@@ -450,7 +449,7 @@ jobs:
450449
- name: Setup testing repo and quickstart
451450
run: |
452451
botaccess=`cat bot-access.txt`
453-
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh storage release_testing
452+
BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh storage nightly_release_testing
454453
- name: Install Secret GoogleService-Info.plist
455454
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
456455
quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"

scripts/release_testing_setup.sh

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,41 @@
1414

1515
set -xe
1616

17+
TESTINGMODE=${1-}
18+
1719
if [ -f "${HOME}/.cocoapods/repos" ]; then
1820
find "${HOME}/.cocoapods/repos" -type d -maxdepth 1 -exec sh -c 'pod repo remove $(basename {})' \;
1921
fi
20-
tag_version="nightly-test-${nightly_test_version}"
2122
git config --global user.email "[email protected]"
2223
git config --global user.name "google-oss-bot"
2324
mkdir -p /tmp/test/firebase-ios-sdk
25+
echo "git clone ${podspec_repo_branch} from github.com/firebase/firebase-ios-sdk.git to ${local_sdk_repo_dir}"
26+
set +x
2427
git clone -q -b "${podspec_repo_branch}" https://"${BOT_TOKEN}"@github.com/firebase/firebase-ios-sdk.git "${local_sdk_repo_dir}"
25-
cd "${local_sdk_repo_dir}"
28+
set -x
2629

30+
if [ "$TESTINGMODE" = "nightly_testing" ]; then
31+
tag_version="nightly-test-${test_version}"
32+
echo "A new tag, ${tag_version},for nightly release testing will be created."
33+
fi
34+
if [ "$TESTINGMODE" = "RC_testing" ]; then
35+
tag_version="CocoaPods-${test_version}.nightly"
36+
echo "A new tag, ${tag_version},for prerelease testing will be created."
37+
fi
2738
# Update a tag.
28-
set +e
29-
# If tag_version is new to the remote, remote cannot delete an unexisted tag,
30-
# so error is allowed here.
31-
git push origin --delete "${tag_version}"
32-
set -e
33-
git tag -f -a "${tag_version}" -m "release testing"
34-
git push origin "${tag_version}"
35-
36-
# Update source and tag, e.g. ":tag => 'CocoaPods-' + s.version.to_s" to
37-
# ":tag => test"
38-
sed -i "" "s/\s*:tag.*/:tag => '${tag_version}'/" *.podspec
39+
if [ -n "$tag_version" ]; then
40+
cd "${local_sdk_repo_dir}"
41+
set +e
42+
# If tag_version is new to the remote, remote cannot delete a non-existent
43+
# tag, so error is allowed here.
44+
git push origin --delete "${tag_version}"
45+
set -e
46+
git tag -f -a "${tag_version}" -m "release testing"
47+
git push origin "${tag_version}"
48+
# Update source and tag, e.g. ":tag => 'CocoaPods-' + s.version.to_s" to
49+
# ":tag => test"
50+
sed -i "" "s/\s*:tag.*/:tag => '${tag_version}'/" *.podspec
51+
fi
3952
cd "${GITHUB_WORKSPACE}/ZipBuilder"
4053
swift build
4154
# Update Pod versions.

scripts/setup_quickstart.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ if check_secrets || [[ ${SAMPLE} == "installations" ]]; then
4040

4141
git clone https://github.com/firebase/quickstart-ios.git
4242
$scripts_dir/localize_podfile.swift quickstart-ios/"$SAMPLE"/Podfile "$RELEASE_TESTING"
43-
if [ ! -z "$RELEASE_TESTING" ]; then
43+
if [ "$RELEASE_TESTING" == "nightly_release_testing" ]; then
4444
set +x
4545
sed -i "" '1i\'$'\n'"source 'https://${BOT_TOKEN}@github.com/FirebasePrivate/SpecsTesting.git'"$'\n' quickstart-ios/"$SAMPLE"/Podfile
4646
set -x
47-
echo "Podfile is updated."
47+
echo "Source of Podfile for nightly release testing is updated."
48+
fi
49+
if [ "$RELEASE_TESTING" == "prerelease_testing" ]; then
50+
set +x
51+
sed -i "" '1i\'$'\n'"source 'https://${BOT_TOKEN}@github.com/FirebasePrivate/SpecsReleasing.git'"$'\n' quickstart-ios/"$SAMPLE"/Podfile
52+
set -x
53+
echo "Source of Podfile for prerelease testing is updated."
4854
fi
4955
cd quickstart-ios/"$SAMPLE"
5056

@@ -53,7 +59,7 @@ if check_secrets || [[ ${SAMPLE} == "installations" ]]; then
5359

5460
bundle update --bundler
5561
bundle install
56-
if [ ! -z "$RELEASE_TESTING" ]; then
62+
if [ -n "$RELEASE_TESTING" ]; then
5763
bundle exec pod update --silent
5864
else
5965
bundle exec pod install

0 commit comments

Comments
 (0)