Skip to content

chore: update workflows (#455) #127

chore: update workflows (#455)

chore: update workflows (#455) #127

Workflow file for this run

# Copyright 2020 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.
name: Release
on:
push:
branches: [ main ]
repository_dispatch:
types: [release]
workflow_dispatch:
jobs:
release:
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
- name: Use Xcode 14.2
run: sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer
- name: Install Dependencies
run: |
brew install carthage
sudo gem install cocoapods
- name: Carthage update
run: |
carthage build --use-xcframeworks
- name: Create XCFramework
run: |
export XCARCHIVE_SIM=Maps.framework-iphonesimulator.xcarchive
export XCARCHIVE_IPHONE=Maps.framework-iphoneos.xcarchive
echo "Creating archive for an iOS Simulator"
xcodebuild archive -project GoogleMapsUtils.xcodeproj -scheme GoogleMapsUtils -configuration Release -destination 'generic/platform=iOS Simulator' -archivePath $XCARCHIVE_SIM SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
echo "Creating archive for an iOS Device"
xcodebuild archive -project GoogleMapsUtils.xcodeproj -scheme GoogleMapsUtils -configuration Release -destination 'generic/platform=iOS' -archivePath $XCARCHIVE_IPHONE SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
export ARCH_IPHONE_SIM=$(lipo -archs ${XCARCHIVE_SIM}/Products/Library/Frameworks/GoogleMapsUtils.framework/GoogleMapsUtils)
echo "Architecture for iPhone Simulator '$ARCH_IPHONE_SIM''"
export ARCH_IPHONE=$(lipo -archs ${XCARCHIVE_IPHONE}/Products/Library/Frameworks/GoogleMapsUtils.framework/GoogleMapsUtils)
echo "Architecture for iPhone '$ARCH_IPHONE''"
echo "Creating XCFramework"
xcodebuild -create-xcframework -framework ./Maps.framework-iphoneos.xcarchive/Products/Library/Frameworks/GoogleMapsUtils.framework -framework ./Maps.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/GoogleMapsUtils.framework -output ./GoogleMapsUtils.xcframework
zip -r ./GoogleMapsUtils.xcframework.zip ./GoogleMapsUtils.xcframework
- name: Update Package.swift checksum
run: |
CHECKSUM=$(swift package compute-checksum ./GoogleMapsUtils.xcframework.zip)
sed -i '' "s/checksum: \"[a-z0-9]*\"/checksum: \"$CHECKSUM\"/g" $GITHUB_WORKSPACE/Package.swift
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3.4.1
with:
extra_plugins: |
"@semantic-release/commit-analyzer@8.0.1"
"@semantic-release/release-notes-generator@9.0.3"
"@google/semantic-release-replace-plugin"
"@semantic-release/exec@5.0.0"
"@semantic-release/git@9.0.1"
"@semantic-release/github@7.2.3"
env:
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}