Skip to content

Commit d05c159

Browse files
authored
feat(ci): Add support for using previous zip run artifact (#15274)
1 parent a623ed1 commit d05c159

File tree

1 file changed

+49
-25
lines changed

1 file changed

+49
-25
lines changed

.github/workflows/zip.yml

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: zip
22

3+
permissions:
4+
actions: read
5+
contents: read
6+
37
on:
48
pull_request:
59
paths:
@@ -21,6 +25,12 @@ on:
2125
description: 'Custom Podspec repos'
2226
required: true
2327
default: 'https://github.com/firebase/SpecsStaging.git'
28+
zip_run_id:
29+
# For example, in the below URL, `17335533279` is the run ID:
30+
# - https://github.com/firebase/firebase-ios-sdk/actions/runs/17335533279
31+
description: 'Run ID of a previous successful zip workflow to use for quickstart testing'
32+
required: false
33+
default: ''
2434

2535
concurrency:
2636
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
@@ -29,7 +39,10 @@ concurrency:
2939
jobs:
3040
package-release:
3141
# Don't run on private repo.
32-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
42+
if: |
43+
github.repository == 'firebase/firebase-ios-sdk' &&
44+
contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) &&
45+
github.event.inputs.zip_run_id == ''
3346
runs-on: macos-14
3447
steps:
3548
- uses: actions/checkout@v4
@@ -57,7 +70,10 @@ jobs:
5770

5871
build:
5972
# Don't run on private repo unless it is a PR.
60-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
73+
if: |
74+
github.repository == 'firebase/firebase-ios-sdk' &&
75+
contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) &&
76+
github.event.inputs.zip_run_id == ''
6177
runs-on: macos-14
6278
steps:
6379
- uses: actions/checkout@v4
@@ -66,11 +82,9 @@ jobs:
6682
- name: Build
6783
run: |
6884
cd ReleaseTooling
69-
swift build -v
85+
# swift build -v
7086

7187
package-head:
72-
# Don't run on private repo.
73-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
7488
needs: build
7589
strategy:
7690
matrix:
@@ -102,9 +116,8 @@ jobs:
102116
path: zip_output_dir
103117

104118
quickstart_framework_abtesting:
105-
# Don't run on private repo.
106-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
107119
needs: package-head
120+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
108121
env:
109122
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
110123
SDK: "ABTesting"
@@ -121,6 +134,8 @@ jobs:
121134
uses: actions/[email protected]
122135
with:
123136
name: ${{ matrix.artifact }}
137+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
138+
github-token: ${{ secrets.GITHUB_TOKEN }}
124139
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
125140
- name: Xcode
126141
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
@@ -160,9 +175,8 @@ jobs:
160175
path: quickstart-ios/
161176

162177
quickstart_framework_auth:
163-
# Don't run on private repo.
164-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
165178
needs: package-head
179+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
166180
env:
167181
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
168182
SDK: "Authentication"
@@ -180,6 +194,8 @@ jobs:
180194
uses: actions/[email protected]
181195
with:
182196
name: ${{ matrix.artifact }}
197+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
198+
github-token: ${{ secrets.GITHUB_TOKEN }}
183199
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
184200
- name: Xcode
185201
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
@@ -210,9 +226,8 @@ jobs:
210226
path: quickstart-ios/
211227

212228
quickstart_framework_config:
213-
# Don't run on private repo.
214-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
215229
needs: package-head
230+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
216231
env:
217232
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
218233
SDK: "Config"
@@ -229,6 +244,8 @@ jobs:
229244
uses: actions/[email protected]
230245
with:
231246
name: ${{ matrix.artifact }}
247+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
248+
github-token: ${{ secrets.GITHUB_TOKEN }}
232249
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
233250
- name: Xcode
234251
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
@@ -258,9 +275,8 @@ jobs:
258275
path: quickstart-ios/
259276

260277
quickstart_framework_crashlytics:
261-
# Don't run on private repo.
262-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
263278
needs: package-head
279+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
264280
env:
265281
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
266282
SDK: "Crashlytics"
@@ -277,6 +293,8 @@ jobs:
277293
uses: actions/[email protected]
278294
with:
279295
name: ${{ matrix.artifact }}
296+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
297+
github-token: ${{ secrets.GITHUB_TOKEN }}
280298
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
281299
- name: Xcode
282300
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
@@ -329,9 +347,8 @@ jobs:
329347
path: quickstart-ios/
330348

331349
quickstart_framework_database:
332-
# Don't run on private repo.
333-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
334350
needs: package-head
351+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
335352
env:
336353
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
337354
SDK: "Database"
@@ -347,6 +364,8 @@ jobs:
347364
uses: actions/[email protected]
348365
with:
349366
name: ${{ matrix.artifact }}
367+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
368+
github-token: ${{ secrets.GITHUB_TOKEN }}
350369
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
351370
- name: Xcode
352371
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
@@ -380,9 +399,8 @@ jobs:
380399
path: quickstart-ios/
381400

382401
quickstart_framework_firestore:
383-
# Don't run on private repo.
384-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
385402
needs: package-head
403+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
386404
env:
387405
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
388406
SDK: "Firestore"
@@ -399,6 +417,8 @@ jobs:
399417
uses: actions/[email protected]
400418
with:
401419
name: ${{ matrix.artifact }}
420+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
421+
github-token: ${{ secrets.GITHUB_TOKEN }}
402422
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
403423
- name: Xcode
404424
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
@@ -436,9 +456,8 @@ jobs:
436456
path: quickstart_artifacts_firestore.zip
437457

438458
check_framework_firestore_symbols:
439-
# Don't run on private repo.
440-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
441459
needs: package-head
460+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
442461
env:
443462
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
444463
runs-on: macos-14
@@ -450,6 +469,8 @@ jobs:
450469
uses: actions/[email protected]
451470
with:
452471
name: Firebase-actions-dir
472+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
473+
github-token: ${{ secrets.GITHUB_TOKEN }}
453474
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
454475
- name: Setup Bundler
455476
run: ./scripts/setup_bundler.sh
@@ -467,9 +488,8 @@ jobs:
467488
"${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/FirebaseFirestoreInternal.xcframework
468489
469490
quickstart_framework_inappmessaging:
470-
# Don't run on private repo.
471-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
472491
needs: package-head
492+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
473493
env:
474494
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
475495
SDK: "InAppMessaging"
@@ -486,6 +506,8 @@ jobs:
486506
uses: actions/[email protected]
487507
with:
488508
name: ${{ matrix.artifact }}
509+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
510+
github-token: ${{ secrets.GITHUB_TOKEN }}
489511
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
490512
- name: Xcode
491513
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
@@ -519,9 +541,8 @@ jobs:
519541
path: quickstart-ios/
520542

521543
quickstart_framework_messaging:
522-
# Don't run on private repo.
523-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
524544
needs: package-head
545+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
525546
env:
526547
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
527548
SDK: "Messaging"
@@ -538,6 +559,8 @@ jobs:
538559
uses: actions/[email protected]
539560
with:
540561
name: ${{ matrix.artifact }}
562+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
563+
github-token: ${{ secrets.GITHUB_TOKEN }}
541564
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
542565
- name: Xcode
543566
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
@@ -571,9 +594,8 @@ jobs:
571594
path: quickstart-ios/
572595

573596
quickstart_framework_storage:
574-
# Don't run on private repo.
575-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
576597
needs: package-head
598+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
577599
env:
578600
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
579601
SDK: "Storage"
@@ -590,6 +612,8 @@ jobs:
590612
uses: actions/[email protected]
591613
with:
592614
name: ${{ matrix.artifact }}
615+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
616+
github-token: ${{ secrets.GITHUB_TOKEN }}
593617
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
594618
- name: Xcode
595619
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer

0 commit comments

Comments
 (0)