-
Notifications
You must be signed in to change notification settings - Fork 1.7k
361 lines (338 loc) · 16.1 KB
/
release.zip.yml
File metadata and controls
361 lines (338 loc) · 16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# This workflow tests the zip distribution of the SDK.
# There are three ways to configure the source of the zip file for testing:
# 1. To iterate on a PR: Set the `PINNED_RUN_ID` environment variable in this
# file to a successful zip packaging run. This is useful for avoiding
# having to manually re-run the packaging jobs for each commit.
# 2. For manual runs: Trigger the workflow via the [GitHub UI](https://github.com/firebase/firebase-ios-sdk/actions/workflows/release.zip.yml)
# and provide a "Run ID of a previous successful zip workflow" in the input.
# 3. By default (for scheduled and other PR runs): The workflow will build the
# zip from the current commit (HEAD).
name: release.zip
# TODO(ncooke3): Also do Xcode 26 testing
permissions:
actions: read
contents: read
env:
# When specified, build jobs will be skipped and the specified
# run's artifacts will be used for testing.
PINNED_RUN_ID: ''
# Firebase's minimum supported Xcode. This is what the binary artifacts are
# built with. Changing this version must only be done in alignment with
# updates to the minimum supported Xcode supported for App Store submissions.
MIN_XCODE: Xcode_16.2 # WARNING: Read above comment.
on:
pull_request:
paths:
- 'ReleaseTooling/Sources/**'
- '.github/workflows/release.zip.yml'
- '.github/workflows/_quickstart.framework.yml'
- 'scripts/zip/**'
- 'Gemfile*'
# Don't run based on any markdown only changes.
- '!ReleaseTooling/*.md'
schedule:
# Run every day at 9pm (PDT) / 12am (EDT) - cron uses UTC times
- cron: '0 4 * * *'
workflow_dispatch:
inputs:
custom_spec_repos:
description: 'Custom Podspec repos'
required: true
default: 'https://github.com/firebase/SpecsStaging.git'
zip_run_id:
# For example, in the below URL, `17335533279` is the run ID:
# - https://github.com/firebase/firebase-ios-sdk/actions/runs/17335533279
description: 'Run ID of a previous successful zip workflow to use for quickstart testing'
required: false
default: ''
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
should_package:
runs-on: ubuntu-latest
outputs:
should_package: ${{ steps.check.outputs.should_package }}
steps:
- name: Fail workflow if PINNED_RUN_ID is set on a schedule
if: github.event_name == 'schedule' && env.PINNED_RUN_ID != ''
run: |
echo "ERROR: PINNED_RUN_ID is set for a scheduled run. Unset it to allow the workflow to proceed."
exit 1
- name: Check if packaging should be skipped
id: check
env:
ZIP_RUN_ID: ${{ github.event.inputs.zip_run_id }}
run: |
if [[ -n "${{ env.PINNED_RUN_ID }}" || -n "$ZIP_RUN_ID" ]]; then
echo "should_package=false" >> "$GITHUB_OUTPUT"
else
echo "should_package=true" >> "$GITHUB_OUTPUT"
fi
package-release:
needs: should_package
# Don't run on private repo.
if: |
github.repository == 'firebase/firebase-ios-sdk' &&
contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) &&
needs.should_package.outputs.should_package == 'true'
runs-on: macos-14
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Xcode
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: ./scripts/setup_bundler.sh
- name: ZipBuildingTest
env:
SPEC_REPOS: ${{ github.event.inputs.custom_spec_repos || 'https://github.com/firebase/SpecsStaging.git' }}
run: |
mkdir -p release_zip_dir
sh -x scripts/zip/build_zip.sh release_zip_dir \
"$SPEC_REPOS" \
build-release \
static
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Firebase-release-zip-zip
# Zip the entire output directory since the builder adds subdirectories we don't know the
# name of.
path: release_zip_dir
build:
needs: should_package
# Don't run on private repo unless it is a PR.
if: |
github.repository == 'firebase/firebase-ios-sdk' &&
contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) &&
needs.should_package.outputs.should_package == 'true'
runs-on: macos-14
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Xcode
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
- name: Build
run: |
cd ReleaseTooling
swift build -v
package-head:
needs: [build, should_package]
if: needs.should_package.outputs.should_package == 'true'
strategy:
matrix:
linking_type: [static, dynamic]
runs-on: macos-14
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Xcode
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: ./scripts/setup_bundler.sh
- name: ZipBuildingTest
env:
SPEC_REPOS: ${{ github.event.inputs.custom_spec_repos || 'https://github.com/firebase/SpecsStaging.git,https://github.com/firebase/SpecsDev.git' }}
run: |
mkdir -p zip_output_dir
sh -x scripts/zip/build_zip.sh \
zip_output_dir "$SPEC_REPOS" \
build-head \
"${{ matrix.linking_type }}"
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: ${{ matrix.linking_type == 'static' && 'Firebase-actions-dir' || 'Firebase-actions-dir-dynamic' }}
# Zip the entire output directory since the builder adds subdirectories we don't know the
# name of.
path: zip_output_dir
packaging_done:
runs-on: ubuntu-latest
needs: [package-head]
if: always()
outputs:
run_id: ${{ steps.get_run_id.outputs.run_id }}
steps:
- name: Check packaging result
if: ${{ needs.package-head.result == 'failure' }}
run: |
echo "Packaging failed. Aborting."
exit 1
- name: Get Run ID
id: get_run_id
env:
ZIP_RUN_ID: ${{ github.event.inputs.zip_run_id }}
run: |
if [[ -n "$ZIP_RUN_ID" ]]; then
echo "run_id=$ZIP_RUN_ID" >> "$GITHUB_OUTPUT"
elif [[ -n "${{ env.PINNED_RUN_ID }}" ]]; then
echo "run_id=${{ env.PINNED_RUN_ID }}" >> "$GITHUB_OUTPUT"
else
echo "run_id=${{ github.run_id }}" >> "$GITHUB_OUTPUT"
fi
check_framework_firestore_symbols:
needs: packaging_done
if: ${{ !cancelled() }}
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
runs-on: macos-14
steps:
- name: Xcode
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Get framework dir
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: Firebase-actions-dir
run-id: ${{ needs.packaging_done.outputs.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: ./scripts/setup_bundler.sh
- name: Install xcpretty
run: gem install xcpretty
- name: Move frameworks
run: |
mkdir -p "${HOME}"/ios_frameworks/
find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} +
- name: Check linked Firestore.xcframework for unlinked symbols.
run: |
scripts/check_firestore_symbols.sh \
"$(pwd)" \
"${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/FirebaseFirestoreInternal.xcframework
quickstart_framework_matrix:
needs: packaging_done
if: github.event.pull_request.head.repo.fork == false && !cancelled()
strategy:
fail-fast: false
matrix:
artifact: [Firebase-actions-dir, Firebase-actions-dir-dynamic]
config:
- product: "ABTesting"
plist_src: "scripts/gha-encrypted/qs-abtesting.plist.gpg"
plist_dst: "quickstart-ios/abtesting/GoogleService-Info.plist"
command: |
SAMPLE="ABTesting" TARGET="ABTestingExample" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCore.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCoreInternal.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FBLPromises.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseInstallations.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleUtilities.xcframework
- product: "Authentication"
plist_src: "scripts/gha-encrypted/qs-authentication.plist.gpg"
plist_dst: "quickstart-ios/authentication/GoogleService-Info.plist"
command: |
SAMPLE="Authentication" TARGET="AuthenticationExample" \
NON_FIREBASE_SDKS="FBSDKLoginKit FBSDKCoreKit FBSDKCoreKit_Basics FBAEMKit" \
scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \
"${HOME}"/ios_frameworks/Firebase/GoogleSignIn/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- product: "Config"
plist_src: "scripts/gha-encrypted/qs-config.plist.gpg"
plist_dst: "quickstart-ios/config/GoogleService-Info.plist"
command: |
SAMPLE="Config" TARGET="ConfigExample" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- product: "Crashlytics"
plist_src: "scripts/gha-encrypted/qs-crashlytics.plist.gpg"
plist_dst: "quickstart-ios/crashlytics/GoogleService-Info.plist"
command: |
rm -rf "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseAnalytics*
rm -rf "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleAppMeasurement*
rm -rf "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleAds*
SAMPLE="Crashlytics" TARGET="CrashlyticsExample" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseCrashlytics/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
cd quickstart-ios/crashlytics
"${GITHUB_WORKSPACE}"/quickstart-ios/scripts/add_framework_script.rb --sdk "Crashlytics" \
--target "CrashlyticsExample_(watchOS)_Extension" \
--framework_path Firebase/
cd ../../
scripts/patch_crashlytics_run_path.rb
- product: "Database"
plist_src: "scripts/gha-encrypted/qs-database.plist.gpg"
plist_dst: "quickstart-ios/database/GoogleService-Info.plist"
os: "macos-14" # Override default
xcode: "Xcode_16.2" # Override default
command: |
SAMPLE="Database" TARGET="DatabaseExample" NON_FIREBASE_SDKS="FirebaseDatabaseUI" \
scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseDatabase/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseStorage/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \
"${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- product: "FirebaseAI"
plist_src: "scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info.plist.gpg"
plist_dst: "quickstart-ios/firebaseai/GoogleService-Info.plist"
scheme: "FirebaseAIExample (iOS)" # Special property
command: |
SAMPLE="$SDK" TARGET="${SDK}Example" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseAILogic/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- product: "Firestore"
plist_src: "scripts/gha-encrypted/qs-firestore.plist.gpg"
plist_dst: "quickstart-ios/firestore/GoogleService-Info.plist"
command: |
SAMPLE="Firestore" TARGET="FirestoreExample" \
NON_FIREBASE_SDKS="SDWebImage FirebaseAuthUI FirebaseEmailAuthUI" \
scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- product: "InAppMessaging"
plist_src: "scripts/gha-encrypted/qs-inappmessaging.plist.gpg"
plist_dst: "quickstart-ios/inappmessaging/GoogleService-Info.plist"
command: |
SAMPLE="InAppMessaging" TARGET="InAppMessagingExample" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseInAppMessaging/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- product: "Messaging"
plist_src: "scripts/gha-encrypted/qs-messaging.plist.gpg"
plist_dst: "quickstart-ios/messaging/GoogleService-Info.plist"
command: |
SAMPLE="Messaging" TARGET="MessagingExample" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseMessaging/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
cd quickstart-ios/messaging
"${GITHUB_WORKSPACE}"/quickstart-ios/scripts/add_framework_script.rb \
--sdk "Messaging" \
--target "NotificationServiceExtension" \
--framework_path Firebase/
- product: "Storage"
plist_src: "scripts/gha-encrypted/qs-storage.plist.gpg"
plist_dst: "quickstart-ios/storage/GoogleService-Info.plist"
command: |
SAMPLE="Storage" TARGET="StorageExample" scripts/zip/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseStorage/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
uses: ./.github/workflows/_quickstart.framework.yml
name: ${{ matrix.config.product }} / ${{ matrix.artifact == 'Firebase-actions-dir' && 'static' || 'dynamic' }}
with:
product: ${{ matrix.config.product }}
zip_run_id: ${{ needs.packaging_done.outputs.run_id }}
artifact_name: ${{ matrix.artifact }}
# Use defaults for most, override for Database
os: ${{ matrix.config.os || 'macos-15' }}
xcode: ${{ matrix.config.xcode || 'Xcode_16.4' }}
# Optional scheme (only used by FirebaseAI)
scheme: ${{ matrix.config.scheme }}
plist_src_path: ${{ matrix.config.plist_src }}
plist_dst_path: ${{ matrix.config.plist_dst }}
setup_command: ${{ matrix.config.command }}
secrets:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}