Radar SDK iOS Release #167
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 | |
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 | |
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphonesimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO | |
- name: Build archive for iPhone device | |
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphoneos.xcarchive" -sdk iphoneos SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO | |
- name: Build XCFramework | |
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: Zip XCFramework | |
run: zip -r RadarSDK.xcframework.zip RadarSDK.xcframework -x ".*" -x "__MACOSX" -D | |
- name: Upload XCFramework to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: RadarSDK.xcframework.zip | |
# get sha256 checksum of the XCFramework | |
- name: Get SHA256 checksum | |
id: checksum | |
run: echo "::set-output name=checksum::$(shasum -a 256 RadarSDK.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.outputs.checksum }}", "url": "${{ github.event.release.html_url }}"}' | |
# Lint and deploy the spec to the CocoaPods trunk | |
- uses: michaelhenry/deploy-to-cocoapods-github-action@1.0.10 | |
env: | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |