Skip to content

ci: ios build workflows #37

ci: ios build workflows

ci: ios build workflows #37

Workflow file for this run

name: Distribute Sample App to App Center & Build Docs
on:
push:
branches: [main, ci, setup-ios]
jobs:
# build-and-deploy-android-sample-app:
# env:
# SAMPLE_APP_PATH: 'apps/sample-app/android'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Setup Bun
# uses: oven-sh/setup-bun@v1
# with:
# bun-version: latest
# - name: Install dependencies
# run: bun install
# - name: Setup JDK
# uses: actions/setup-java@v4
# with:
# distribution: 'zulu'
# java-version: '17'
# - name: Add secrets to `local.properties`
# run: |
# echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties &&
# echo FACEBOOK_APP_ID=${{ secrets.FACEBOOK_APP_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties &&
# echo FACEBOOK_CLIENT_TOKEN=${{ secrets.FACEBOOK_CLIENT_TOKEN }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties &&
# echo DROPBOX_APP_KEY=${{ secrets.DROPBOX_APP_KEY }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties &&
# echo MICROSOFT_CLIENT_ID=${{ secrets.MICROSOFT_CLIENT_ID }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties &&
# echo MICROSOFT_HOST_PATH=com.openmobilehub.reactnative.auth.sample.MainApplication >> ${{ env.SAMPLE_APP_PATH }}/local.properties &&
# echo MICROSOFT_SIGNATURE_HASH=${{ secrets.MICROSOFT_SIGNATURE_HASH }} >> ${{ env.SAMPLE_APP_PATH }}/local.properties
# - name: Build release
# run: |
# cd ${{ env.SAMPLE_APP_PATH }}
# ./gradlew assembleRelease
# - name: Upload .apk to App Center
# uses: wzieba/AppCenter-Github-Action@v1
# with:
# appName: Callstack-dev/RN-Android-OMH-Auth-Sample
# group: Testers
# token: ${{ secrets.APP_CENTER_TOKEN }}
# file: ${{ env.SAMPLE_APP_PATH }}/app/build/outputs/apk/release/app-release.apk
# notifyTesters: true
# debug: true
# gitReleaseNotes: true
build-and-deploy-ios-sample-app:
env:
SAMPLE_APP_PATH: 'apps/sample-app/ios'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: KEYCHAIN_PASSWORD
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: install Cocoapod dependencies
run: |
cd ${{ env.SAMPLE_APP_PATH }}
pod repo update
pod install
- name: build archive
run: |
cd ${{ env.SAMPLE_APP_PATH }}
xcodebuild -workspace SampleApp.xcworkspace \
-scheme "SampleApp" \
-sdk iphoneos \
-configuration Debug \
-destination generic/platform=iOS \
-archivePath $RUNNER_TEMP/SampleApp.xcarchive \
archive
- name: export ipa
env:
EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST }}
run: |
# create variables
EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
# import profile lists from secrets
echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
# extract .ipa
xcodebuild -exportArchive -archivePath $RUNNER_TEMP/SampleApp.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath $RUNNER_TEMP/build
ls $RUNNER_TEMP/build
- name: Upload .ipa to App Center
uses: wzieba/AppCenter-Github-Action@v1
with:
appName: Callstack-dev/RN-iOS-OMH-Auth-Sample
group: Testers
token: ${{ secrets.APP_CENTER_TOKEN }}
file: $RUNNER_TEMP/build/SampleApp.ipa
notifyTesters: true
debug: true
gitReleaseNotes: true
# build-docs:
# runs-on: macos-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Setup Bun
# uses: oven-sh/setup-bun@v1
# with:
# bun-version: latest
# - name: Install dependencies
# run: bun install
# - name: Build docs
# run: |
# cd docs
# bun run build
# - name: Upload Build Artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: docs/build
# deploy-docs:
# needs: build-docs
# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# permissions:
# pages: write # to deploy to Pages
# id-token: write # to verify the deployment originates from an appropriate source
# # Deploy to the github-pages environment
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4