Skip to content

Commit bde2a17

Browse files
feat!: Bump minimum to iOS 14 (#444)
* feat!: Bump minimum to iOS 14 * chore: migrate from src and test to Sources and Test * chore: flatten header directory structure * Added example model of MockMapView.. * refactor: rename ObjC target * fix: use exported to expose ObjC to Swift * feat: add privacy manifest (empty) * chore: consolidate build and test workflows * chore: convert to release please * chore: add publish workflow * chore: remove obsolete files * chore: update contributing guide --------- Co-authored-by: Wayne Bishop <[email protected]>
1 parent c061e69 commit bde2a17

File tree

197 files changed

+1594
-3244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+1594
-3244
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,83 @@
1313
# limitations under the License.
1414

1515
# A workflow that runs tests on every new pull request
16-
name: Build apps
16+
name: Build and Test
1717

1818
on:
1919
repository_dispatch:
2020
types: [build]
2121
pull_request:
2222
branches: ['*']
23+
workflow_call:
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
2328

2429
jobs:
25-
build_dev_app:
30+
build_test_swift_package:
31+
name: Build Swift Package
2632
runs-on: macos-latest
2733

2834
steps:
29-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
35+
# Checks out the repository under $GITHUB_WORKSPACE so this job can access it
3036
- name: Checkout google-maps-ios-utils
31-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
38+
39+
# Specify the latest stable Xcode version, since the default for macos-latest might not meet SDK minimum Xcode requirements.
40+
- name: Set Xcode version
41+
uses: maxim-lobanov/setup-xcode@v1
42+
with:
43+
xcode-version: latest-stable
44+
45+
# For as long as this is a mixed-language library, swift build will not support the Obj-C part of the code so we must use xcodebuild.
46+
- name: Build and analyze Swift Package with xcodebuild
47+
run: |
48+
xcodebuild clean build analyze \
49+
-scheme GoogleMapsUtils -configuration Debug \
50+
-destination "platform=iOS Simulator,OS=17.4,name=iPhone 15" \
51+
-disableAutomaticPackageResolution | xcpretty
52+
53+
- name: Run unit tests on Swift Package
54+
run: |
55+
xcodebuild test -scheme GoogleMapsUtils \
56+
-destination "platform=iOS Simulator,OS=17.4,name=iPhone 15" \
57+
-disableAutomaticPackageResolution
58+
59+
- name: Upload test results to CodeCov
60+
run: bash <(curl -s https://codecov.io/bash)
61+
62+
# Dev App CI removed; use Sample Apps instead
63+
# build_dev_app:
64+
# runs-on: macos-latest
65+
66+
# - name: Build DevApp
67+
# run: |
68+
# xcodebuild -scheme DevApp -configuration Debug -destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty
69+
70+
build_test_cocoapod:
71+
name: Build and test the CocoaPod spec
72+
runs-on: macos-latest
73+
steps:
74+
# Checks out the repository under $GITHUB_WORKSPACE so this job can access it
75+
- name: Checkout google-maps-ios-utils
76+
uses: actions/checkout@v4
3277

3378
- name: Install Dependencies
3479
run: sudo gem install cocoapods
3580

36-
- name: CocoaPods spec lint
81+
# Validate the library for CocoaPods locally
82+
- name: CocoaPods lib lint
3783
run: pod lib lint Google-Maps-iOS-Utils.podspec
3884

39-
- name: Build DevApp
40-
run: |
41-
xcodebuild -scheme DevApp -configuration Debug -destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty
42-
4385
build_swift_sample:
86+
name: Build Swift Sample App with CocoaPods locally
4487
runs-on: macos-latest
4588

4689
steps:
4790
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
4891
- name: Checkout google-maps-ios-utils
49-
uses: actions/checkout@v3
92+
uses: actions/checkout@v4
5093

5194
- name: Install Dependencies
5295
run: sudo gem install cocoapods
@@ -58,9 +101,10 @@ jobs:
58101
run: |
59102
xcodebuild -workspace samples/SwiftDemoApp/SwiftDemoApp.xcworkspace \
60103
-scheme SwiftDemoApp -configuration Debug \
61-
-destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty
104+
-destination "platform=iOS Simulator,OS=17.5,name=iPhone 15" build | xcpretty
62105
63106
build_objc_sample:
107+
name: Build Objective-C Sample App with CocoaPods locally
64108
runs-on: macos-latest
65109

66110
steps:
@@ -78,15 +122,17 @@ jobs:
78122
run: |
79123
xcodebuild -workspace samples/ObjCDemoApp/ObjCDemoApp.xcworkspace \
80124
-scheme ObjCDemoApp -configuration Debug \
81-
-destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty
125+
-destination "platform=iOS Simulator,OS=17.5,name=iPhone 15" build | xcpretty
82126
83127
test: # used as required status check
84128
runs-on: ubuntu-latest
85129
continue-on-error: false
86130
strategy:
87131
fail-fast: true
88132
needs:
89-
- build_dev_app
133+
- build_test_swift_package
134+
# - build_dev_app
135+
- build_test_cocoapod
90136
- build_swift_sample
91137
- build_objc_sample
92138
steps:

.github/workflows/dependabot.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# A workflow that publishes the library to CocoaPods
16+
name: Publish
17+
18+
on:
19+
workflow_call: # called when release-please steps.release.outputs.release_created
20+
workflow_dispatch: # manually trigger if previous runs failed
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
build-and-test:
28+
uses: ./.github/workflows/build.yml
29+
30+
publish:
31+
runs-on: ubuntu-latest
32+
needs: build-and-test
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Install CocoaPods
38+
run: sudo gem install cocoapods
39+
40+
- name: pod trunk push
41+
env:
42+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
43+
run: pod trunk push Google-Maps-iOS-Utils.podspec
44+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
name: Release Please
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
id: release
19+
with:
20+
config-file: release-please-config.json
21+
manifest-file: .release-please-manifest.json
22+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
23+
default-branch: main
24+
25+
- name: Echo release outputs
26+
if: ${{ steps.release.outputs }}
27+
run: echo '${{ toJson(steps.release) }}'
28+
continue-on-error: true
29+
30+
# Call the Publish workflow to publish to CocoaPods when a release is cut.
31+
# Note the "if" statement on all commands to make sure that publishing
32+
# only happens when a release is cut.
33+
34+
- if: ${{ steps.release.outputs.release_created }}
35+
name: Start publish
36+
uses: ./.github/workflows/publish.yml

.github/workflows/release.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
.DS_Store
33
.build/
44
build/
5+
.build/
6+
.swiftpm/
57
*.pbxuser
68
!default.pbxuser
79
*.mode1v3

0 commit comments

Comments
 (0)