From 20a5aa741a1470f73295e3646606f886d05cf7c3 Mon Sep 17 00:00:00 2001 From: Sara Tavares <29093946+stavares843@users.noreply.github.com> Date: Tue, 29 Oct 2024 23:47:34 +0000 Subject: [PATCH] chore(ios): ios stuff (#791) --- .github/workflows/ios-build.yml | 84 +++++++++++++++++++++++++++++++++ ios/App/ExportOptions.plist | 15 ++++++ ios/App/Podfile.lock | 2 +- 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ios-build.yml create mode 100644 ios/App/ExportOptions.plist diff --git a/.github/workflows/ios-build.yml b/.github/workflows/ios-build.yml new file mode 100644 index 000000000..cdc02eed2 --- /dev/null +++ b/.github/workflows/ios-build.yml @@ -0,0 +1,84 @@ +name: Build iOS App + +on: + push: + branches: + - main + +jobs: + build: + runs-on: macos-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1.197.0 + with: + ruby-version: '3.3' + + - name: Install CocoaPods + working-directory: ios/App + run: | + npm i + gem install cocoapods + pod install + + - name: Import Signing Certificate + env: + MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} + MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} + MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} + run: | + # Create the keychain + security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" build.keychain + + # Unlock the keychain + security unlock-keychain -p "$MACOS_KEYCHAIN_PASSWORD" build.keychain + + # Set the keychain as the default + security list-keychains -s build.keychain + + # Import the certificate directly from the environment variable + security import <(echo "$MACOS_CERTIFICATE" | base64 --decode) \ + -f pkcs12 \ + -k build.keychain \ + -P "$MACOS_CERTIFICATE_PWD" \ + -T /usr/bin/codesign || { echo "Import failed"; exit 1; } + + # Set the key partition list + security set-key-partition-list -S apple-tool:,apple: -s -k "$MACOS_KEYCHAIN_PASSWORD" build.keychain + + - name: Debug Provisioning Profiles + run: | + # Create the directory if it does not exist + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + + # List the contents of the provisioning profiles directory + echo "Provisioning Profiles Directory Contents:" + ls ~/Library/MobileDevice/Provisioning\ Profiles + + # Print the expected provisioning profile path + echo "Expected path for the provisioning profile:" + echo "~/Library/MobileDevice/Provisioning Profiles/your_provisioning_profile.mobileprovision" + + - name: Download and Install Provisioning Profile + run: | + echo "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/your_provisioning_profile.mobileprovision + + - name: Build the iOS App + working-directory: ios/App + run: | + xcodebuild -workspace App.xcworkspace -scheme App -sdk iphoneos -configuration Release archive -archivePath ${{ github.workspace }}/build/App.xcarchive DEVELOPMENT_TEAM="${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}" -allowProvisioningUpdates + + - name: Export .ipa File + working-directory: ios/App + run: | + xcodebuild -exportArchive -archivePath ${{ github.workspace }}/build/App.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath ${{ github.workspace }}/build + + - name: Upload .ipa to Artifacts + uses: actions/upload-artifact@v4 + with: + name: App.ipa + path: ${{ github.workspace }}/build/*.ipa diff --git a/ios/App/ExportOptions.plist b/ios/App/ExportOptions.plist new file mode 100644 index 000000000..1bb35c931 --- /dev/null +++ b/ios/App/ExportOptions.plist @@ -0,0 +1,15 @@ + + + + + method + development + teamID + ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} + provisioningProfiles + + com.Satellite.Uplink + App + + + diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock index 41ed3b31b..b8d91504a 100644 --- a/ios/App/Podfile.lock +++ b/ios/App/Podfile.lock @@ -25,4 +25,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: d641883bb20843cf484024fa8ccc257a419b4040 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.1