Skip to content

Commit

Permalink
chore(ios): ios stuff (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
stavares843 authored Oct 29, 2024
1 parent 276996a commit 20a5aa7
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
84 changes: 84 additions & 0 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
15 changes: 15 additions & 0 deletions ios/App/ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>development</string>
<key>teamID</key>
<string>${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}</string>
<key>provisioningProfiles</key>
<dict>
<key>com.Satellite.Uplink</key>
<string>App</string>
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: d641883bb20843cf484024fa8ccc257a419b4040

COCOAPODS: 1.15.2
COCOAPODS: 1.16.1

0 comments on commit 20a5aa7

Please sign in to comment.