Skip to content

Commit

Permalink
feat!: Bump minimum to iOS 14 (#444)
Browse files Browse the repository at this point in the history
* 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 <waynewbishop@users.noreply.github.com>
  • Loading branch information
wangela and waynewbishop authored Jul 30, 2024
1 parent c061e69 commit bde2a17
Show file tree
Hide file tree
Showing 197 changed files with 1,594 additions and 3,244 deletions.
72 changes: 59 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,83 @@
# limitations under the License.

# A workflow that runs tests on every new pull request
name: Build apps
name: Build and Test

on:
repository_dispatch:
types: [build]
pull_request:
branches: ['*']
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_dev_app:
build_test_swift_package:
name: Build Swift Package
runs-on: macos-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Checks out the repository under $GITHUB_WORKSPACE so this job can access it
- name: Checkout google-maps-ios-utils
uses: actions/checkout@v3
uses: actions/checkout@v4

# Specify the latest stable Xcode version, since the default for macos-latest might not meet SDK minimum Xcode requirements.
- name: Set Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

# 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.
- name: Build and analyze Swift Package with xcodebuild
run: |
xcodebuild clean build analyze \
-scheme GoogleMapsUtils -configuration Debug \
-destination "platform=iOS Simulator,OS=17.4,name=iPhone 15" \
-disableAutomaticPackageResolution | xcpretty
- name: Run unit tests on Swift Package
run: |
xcodebuild test -scheme GoogleMapsUtils \
-destination "platform=iOS Simulator,OS=17.4,name=iPhone 15" \
-disableAutomaticPackageResolution
- name: Upload test results to CodeCov
run: bash <(curl -s https://codecov.io/bash)

# Dev App CI removed; use Sample Apps instead
# build_dev_app:
# runs-on: macos-latest

# - name: Build DevApp
# run: |
# xcodebuild -scheme DevApp -configuration Debug -destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty

build_test_cocoapod:
name: Build and test the CocoaPod spec
runs-on: macos-latest
steps:
# Checks out the repository under $GITHUB_WORKSPACE so this job can access it
- name: Checkout google-maps-ios-utils
uses: actions/checkout@v4

- name: Install Dependencies
run: sudo gem install cocoapods

- name: CocoaPods spec lint
# Validate the library for CocoaPods locally
- name: CocoaPods lib lint
run: pod lib lint Google-Maps-iOS-Utils.podspec

- name: Build DevApp
run: |
xcodebuild -scheme DevApp -configuration Debug -destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty
build_swift_sample:
name: Build Swift Sample App with CocoaPods locally
runs-on: macos-latest

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

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

steps:
Expand All @@ -78,15 +122,17 @@ jobs:
run: |
xcodebuild -workspace samples/ObjCDemoApp/ObjCDemoApp.xcworkspace \
-scheme ObjCDemoApp -configuration Debug \
-destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty
-destination "platform=iOS Simulator,OS=17.5,name=iPhone 15" build | xcpretty
test: # used as required status check
runs-on: ubuntu-latest
continue-on-error: false
strategy:
fail-fast: true
needs:
- build_dev_app
- build_test_swift_package
# - build_dev_app
- build_test_cocoapod
- build_swift_sample
- build_objc_sample
steps:
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/dependabot.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A workflow that publishes the library to CocoaPods
name: Publish

on:
workflow_call: # called when release-please steps.release.outputs.release_created
workflow_dispatch: # manually trigger if previous runs failed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
uses: ./.github/workflows/build.yml

publish:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install CocoaPods
run: sudo gem install cocoapods

- name: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: pod trunk push Google-Maps-iOS-Utils.podspec

36 changes: 36 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write

name: Release Please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
default-branch: main

- name: Echo release outputs
if: ${{ steps.release.outputs }}
run: echo '${{ toJson(steps.release) }}'
continue-on-error: true

# Call the Publish workflow to publish to CocoaPods when a release is cut.
# Note the "if" statement on all commands to make sure that publishing
# only happens when a release is cut.

- if: ${{ steps.release.outputs.release_created }}
name: Start publish
uses: ./.github/workflows/publish.yml
85 changes: 0 additions & 85 deletions .github/workflows/release.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.DS_Store
.build/
build/
.build/
.swiftpm/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
Loading

0 comments on commit bde2a17

Please sign in to comment.