chore: update workflows (#455) #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/[email protected] | |
with: | |
extra_plugins: | | |
"@semantic-release/[email protected]" | |
"@semantic-release/[email protected]" | |
"@google/semantic-release-replace-plugin" | |
"@semantic-release/[email protected]" | |
"@semantic-release/[email protected]" | |
"@semantic-release/[email protected]" | |
env: | |
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |