3.19.2-beta.6 #218
Workflow file for this run
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
# When a new release is created on GitHub, this workflow builds the SDK as an XCFramework, | |
# generates the API documents, and pushes a CocoaPods update. | |
name: Radar SDK iOS Release | |
on: | |
# Triggered when a new release is tagged in GitHub. | |
release: | |
types: [ published ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build, test, and analyze (RadarSDK) | |
run: xcodebuild clean build analyze test -workspace Example/Example.xcodeproj/project.xcworkspace -scheme RadarSDK -destination "platform=iOS Simulator,name=iPhone 15 Pro" | xcpretty | |
- name: Build archive for iPhone simulator (RadarSDK) | |
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphonesimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
- name: Build archive for iPhone device (RadarSDK) | |
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphoneos.xcarchive" -sdk iphoneos SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
- name: Build archive for iPhone simulator (RadarSDKMotion) | |
run: cd RadarSDKMotion && xcodebuild archive -scheme RadarSDKMotion -archivePath "../RadarSDKMotion-iphonesimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO | |
- name: Build archive for iPhone device (RadarSDKMotion) | |
run: cd RadarSDKMotion && xcodebuild archive -scheme RadarSDKMotion -archivePath "../RadarSDKMotion-iphoneos.xcarchive" -sdk iphoneos SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO | |
- name: Build XCFramework (RadarSDK) | |
run: xcodebuild -create-xcframework -framework RadarSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/RadarSDK.framework -framework RadarSDK-iphoneos.xcarchive/Products/Library/Frameworks/RadarSDK.framework -output RadarSDK.xcframework | |
- name: Build XCFramework (RadarSDKMotion) | |
run: xcodebuild -create-xcframework -framework RadarSDKMotion-iphonesimulator.xcarchive/Products/Library/Frameworks/RadarSDKMotion.framework -framework RadarSDKMotion-iphoneos.xcarchive/Products/Library/Frameworks/RadarSDKMotion.framework -output RadarSDKMotion.xcframework | |
- name: Zip XCFramework (RadarSDK) | |
run: zip -r RadarSDK.xcframework.zip RadarSDK.xcframework -x ".*" -x "__MACOSX" -D | |
- name: Zip XCFramework (RadarSDKMotion) | |
run: zip -r RadarSDKMotion.xcframework.zip RadarSDKMotion.xcframework -x ".*" -x "__MACOSX" -D | |
- name: Upload XCFramework to release (RadarSDK) | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: RadarSDK.xcframework.zip | |
- name: Upload XCFramework to release (RadarSDKMotion) | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: RadarSDKMotion.xcframework.zip | |
# get sha256 checksum of the XCFramework | |
- name: Get SHA256 checksum (RadarSDK) | |
id: checksum_radarsdk | |
run: echo "::set-output name=checksum::$(shasum -a 256 RadarSDK.xcframework.zip | cut -d ' ' -f 1)" | |
- name: Get SHA256 checksum (RadarSDKMotion) | |
id: checksum_radarsdkmotion | |
run: echo "::set-output name=checksum::$(shasum -a 256 RadarSDKMotion.xcframework.zip | cut -d ' ' -f 1)" | |
- name: Repository Dispatch | |
if: ${{ !github.event.release.prerelease }} | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.SPM_REPO_KEY }} | |
repository: radarlabs/radar-sdk-ios-spm | |
event-type: update-xcframework | |
client-payload: '{"release": "${{ github.event.release.tag_name }}", "checksum": "${{ steps.checksum_radarsdk.outputs.checksum }}", "url": "${{ github.event.release.html_url }}", "checksum_motion": "${{ steps.checksum_radarsdkmotion.outputs.checksum }}"}' | |
- name: Check versions is not duplicate | |
run: | | |
VERSION=$(pod ipc spec RadarSDK.podspec | jq -r .version) | |
! pod trunk info RadarSDK | grep -q $VERSION | |
echo "RadarSDK version is OK" | |
VERSION=$(pod ipc spec RadarSDKMotion.podspec | jq -r .version) | |
! pod trunk info RadarSDKMotion | grep -q $VERSION | |
echo "RadarSDKMotion version is OK" | |
- name: Deploy to Cocoapods | |
run: | | |
set -eo pipefail | |
gem install cocoapods | |
pod lib lint --allow-warnings RadarSDK.podspec | |
pod lib lint --allow-warnings RadarSDKMotion.podspec | |
pod trunk push --allow-warnings RadarSDK.podspec | |
pod trunk push --allow-warnings RadarSDKMotion.podspec | |
env: | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |