[update] version 24.12.0 #278
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
# Workflow supports podspec verification for iOS SDK 9.x (iOS 15) and iOS SDK 10.x (iOS 16) | |
name: CI | |
on: | |
push: | |
branches: [ main, ci-test ] | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
frameworkVersion: | |
description: 'Framework Version' | |
required: true | |
default: '9.2.7' | |
iOSVersion: | |
description: 'iOS Version' | |
required: true | |
default: '15.0' | |
jobs: | |
verify-podspec-install: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create .netrc file with credentials to download binaries from SAP RSBC | |
uses: bcomnes/netrc-creds@v3 | |
with: | |
machine: rbsc.repositories.cloud.sap | |
login: sap-sdkiospecs | |
password: ${{ secrets.RSBC_USER_BASICAUTH_PWD }} | |
- name: Install required tools | |
run: brew install xcodegen | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v41 | |
if: github.event_name != 'workflow_dispatch' | |
- name: Determine relevant podspec versions (based on changed files) | |
id: frameworkVersion | |
if: github.event_name != 'workflow_dispatch' | |
run: | | |
relevantVersion=9.0.1 # safeguard in case no podspec file(s) were changed | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
lastVersion=`echo ${file} | cut -d / -f 2` | |
[[ $lastVersion == [0-9]* ]] && relevantVersion=$lastVersion | |
echo "File checked: ${file}." | |
done | |
echo ${relevantVersion} | |
echo "determinedFrameworkVersion=$relevantVersion" >> $GITHUB_ENV | |
- name: Comment on PR if no framework version can be determined | |
if: github.event_name == 'pull_request' && env.determinedFrameworkVersion == '9.0.1' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '🚨 Cannot determine relevant framework version' | |
}) | |
- name: Determine iOSVersion | |
id: iOSVersion | |
if: github.event_name != 'workflow_dispatch' | |
run: | | |
frameworkVersion=${{ env.determinedFrameworkVersion }} | |
majorMinorVersion=$(echo $frameworkVersion | cut -d '.' -f 1-2) | |
if [ "$majorMinorVersion" = "24.12" ]; then | |
iOSVersion="17.0" | |
elif [ "$majorMinorVersion" = "24.8" ] || [ "$majorMinorVersion" = "24.4" ] || [ "$majorMinorVersion" = "10.0" ]; then | |
iOSVersion="16.0" | |
else | |
iOSVersion="16.0" # Default fallback | |
fi | |
echo "Framework version: $frameworkVersion -> iOS version: $iOSVersion" | |
echo "iOSVersion=$iOSVersion" >> $GITHUB_ENV - name: Create Podfile with latest podspecs | |
- name: Create Podfile with latest podspecs | |
if: github.event_name != 'workflow_dispatch' | |
run: | | |
cd .testing | |
rm Podfile | |
echo "platform :ios, '${{ env.iOSVersion }}'" >> Podfile | |
echo "use_frameworks!" >> Podfile | |
echo "target 'TestApp' do" >> Podfile | |
echo " pod 'SAPCommon', :podspec => '../SAPCommon/${{ env.determinedFrameworkVersion }}/SAPCommon.podspec'" >> Podfile | |
echo " pod 'SAPFoundation', :podspec => '../SAPFoundation/${{ env.determinedFrameworkVersion }}/SAPFoundation.podspec'" >> Podfile | |
echo " pod 'SAPFiori', :podspec => '../SAPFiori/${{ env.determinedFrameworkVersion }}/SAPFiori.podspec'" >> Podfile | |
echo " pod 'SAPFioriFlows', :podspec => '../SAPFioriFlows/${{ env.determinedFrameworkVersion }}/SAPFioriFlows.podspec'" >> Podfile | |
echo " pod 'SAPOData', :podspec => '../SAPOData/${{ env.determinedFrameworkVersion }}/SAPOData.podspec'" >> Podfile | |
echo " pod 'SAPOfflineOData', :podspec => '../SAPOfflineOData/${{ env.determinedFrameworkVersion }}/SAPOfflineOData.podspec'" >> Podfile | |
echo " pod 'SAPML', :podspec => '../SAPML/${{ env.determinedFrameworkVersion }}/SAPML.podspec'" >> Podfile | |
echo "end" >> Podfile | |
cat Podfile | |
- name: Create Podfile with version specified manually | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
cd .testing | |
rm Podfile | |
echo "platform :ios, '${{ github.event.inputs.iOSVersion }}'" >> Podfile | |
echo "use_frameworks!" >> Podfile | |
echo "target 'TestApp' do" >> Podfile | |
echo " pod 'SAPCommon', :podspec => '../SAPCommon/${{ github.event.inputs.frameworkVersion }}/SAPCommon.podspec'" >> Podfile | |
echo " pod 'SAPFoundation', :podspec => '../SAPFoundation/${{ github.event.inputs.frameworkVersion }}/SAPFoundation.podspec'" >> Podfile | |
echo " pod 'SAPFiori', :podspec => '../SAPFiori/${{ github.event.inputs.frameworkVersion }}/SAPFiori.podspec'" >> Podfile | |
echo " pod 'SAPFioriFlows', :podspec => '../SAPFioriFlows/${{ github.event.inputs.frameworkVersion }}/SAPFioriFlows.podspec'" >> Podfile | |
echo " pod 'SAPOData', :podspec => '../SAPOData/${{ github.event.inputs.frameworkVersion }}/SAPOData.podspec'" >> Podfile | |
echo " pod 'SAPOfflineOData', :podspec => '../SAPOfflineOData/${{ github.event.inputs.frameworkVersion }}/SAPOfflineOData.podspec'" >> Podfile | |
echo " pod 'SAPML', :podspec => '../SAPML/${{ github.event.inputs.frameworkVersion }}/SAPML.podspec'" >> Podfile | |
echo "end" >> Podfile | |
cat Podfile | |
- name: "Displays Xcode current version" | |
run: sudo xcode-select -p | |
- name: Determine Xcode version based on iOS version | |
run: | | |
if [[ ${{ env.iOSVersion }} == '17.0' ]]; then | |
neededXcode='Xcode_16.1' | |
else | |
neededXcode='Xcode_15.4' | |
fi | |
echo "neededXcode=$neededXcode" >> $GITHUB_ENV | |
- name: "Set Xcode version" | |
if: env.neededXcode != '' | |
run: sudo xcode-select -s /Applications/${{ env.neededXcode }}.app/Contents/Developer | |
- name: Create test application | |
run: | | |
cd .testing | |
xcodegen generate | |
- name: Install pods for test application | |
run: | | |
cd .testing | |
pod install | |
- name: Build test application (which uses the frameworks) | |
run: | | |
cd .testing | |
xcodebuild -workspace TestApp.xcworkspace -scheme 'TestApp' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15' clean build |