Skip to content

Commit

Permalink
Upload iOS App to testflight
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-powell committed Dec 23, 2023
1 parent 1ec09d3 commit 9147f54
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- ios-upload-testflight # TODO: this is a temporary branch for testing (REMOVE)
pull_request:

concurrency:
Expand All @@ -25,16 +26,19 @@ jobs:
BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_DEV_CERT }}
P12_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.IOS_PROVISIONING_PROFILE }}
DISTRIBUTION_PROFILE_BASE64: ${{ secrets.IOS_DISTRIBUTION_PROFILE }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
DISTRO_PP_PATH=$RUNNER_TEMP/distro_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
echo -n "$DISTRIBUTION_PROFILE_BASE64" | base64 --decode -o $DISTRO_PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
Expand All @@ -48,6 +52,7 @@ jobs:
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
cp $DISTRO_PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -61,33 +66,31 @@ jobs:
with:
gradle-home-cache-cleanup: true

- name: Build with Xcode
run: xcodebuild -project iosApp/iosApp.xcodeproj -scheme iosApp -configuration Debug -destination generic/platform=iOS -archivePath $RUNNER_TEMP/Tidy.xcarchive
- name: Build Artifact with Xcode
run: xcodebuild -project iosApp/iosApp.xcodeproj -scheme iosApp -configuration Debug -destination generic/platform=iOS -archivePath $RUNNER_TEMP/Tidy.xcarchive archive

- name: Upload Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: iOS Archive
path: $RUNNER_TEMP/Tidy/**/*.xcarchive
path: $RUNNER_TEMP/**/*.xcarchive

# Only run the following steps when a push event occurs on main branch
- name: Build App Artifact with Xcode
- name: Build IPA Artifact with Xcode
if: github.event_name == 'push'
env:
EXPORT_OPTIONS_PLIST: ${{ secrets.IOS_EXPORT_OPTIONS }}
IOS_EXPORT_OPTIONS: ${{ secrets.IOS_EXPORT_OPTIONS }}
run: |
EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
echo -n "IOS_EXPORT_OPTIONS" | base64 --decode -o $RUNNER_TEMP/exportOptions.plist
xcodebuild -archivePath $RUNNER_TEMP/iosApp.xcarchive
-exportArchive -exportPath '$RUNNER_TEMP/Tidy.app'
-exportOptionsPlist $RUNNER_TEMP/exportOptions.plist
echo -n "$IOS_EXPORT_OPTIONS" | base64 --decode -o $EXPORT_OPTS_PATH
xcodebuild -exportArchive -archivePath $RUNNER_TEMP/Tidy.xcarchive -exportPath '$RUNNER_TEMP/Tidy.ipa' -exportOptionsPlist $EXPORT_OPTS_PATH
- name: Upload to Github Artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
with:
name: app
path: $RUNNER_TEMP/**/*.app
path: $RUNNER_TEMP/**/*.ipa

- name: Copy App Store Private Key
if: github.event_name == 'push'
Expand Down

0 comments on commit 9147f54

Please sign in to comment.