Skip to content

Commit da4819b

Browse files
authored
Build zip in GHA cron (#4593)
1 parent fc8639f commit da4819b

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

.github/workflows/cron.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CRON
2+
3+
on:
4+
schedule:
5+
# Run every day at 1am (PST) - cron uses UTC times
6+
- cron: '0 7 * * *'
7+
8+
jobs:
9+
zip:
10+
needs: check
11+
runs-on: macOS-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up
15+
run: |
16+
bundle install
17+
bundle exec pod --version
18+
- name: ZipBuildingTest
19+
run: ./scripts/build_zip.sh

ZipBuilder/Sources/ZipBuilder/CocoaPodUtils.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,16 @@ enum CocoaPodUtils {
328328
podfile += "\n"
329329
}
330330

331-
// If we're using local pods, explicitly add Google* podspecs if they exist and there are no
331+
// If we're using local pods, explicitly add FirebaseInstanceID, FirebaseInstallations,
332+
// and any Google* podspecs if they exist and there are no
332333
// explicit versions in the Podfile. Note there are versions for local podspecs if we're doing
333334
// the secondary install for module map building.
334335
if !versionsSpecified, let localURL = LaunchArgs.shared.localPodspecPath {
335336
let podspecs = try! FileManager.default.contentsOfDirectory(atPath: localURL.path)
336337
for podspec in podspecs {
337-
if podspec.starts(with: "Google"), podspec.hasSuffix(".podspec") {
338+
if (podspec == "FirebaseInstanceID.podspec" ||
339+
podspec == "FirebaseInstallations.podspec") ||
340+
podspec.starts(with: "Google"), podspec.hasSuffix(".podspec") {
338341
let podName = podspec.replacingOccurrences(of: ".podspec", with: "")
339342
podfile += " pod '\(podName)', :path => '\(localURL.path)/\(podspec)'\n"
340343
}

scripts/build_zip.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Copyright 2020 Google
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
set -x
15+
REPO=`pwd`
16+
cd ZipBuilder
17+
swift run ReleasePackager -keepBuildArtifacts true -updatePodRepo true \
18+
-templateDir "${REPO}"/ZipBuilder/Template -localPodspecPath "${REPO}"

0 commit comments

Comments
 (0)