generated from JetBrains/compose-multiplatform-ios-android-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CI and fix iOS debug build (#9)
- Loading branch information
Showing
4 changed files
with
107 additions
and
15 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
|
||
- name: Build Shared | ||
# TODO Understand why compileIosMainKotlinMetadata fails every time | ||
run: ./gradlew shared:build -x compileIosMainKotlinMetadata | ||
run: ./gradlew shared:assemble -x compileIosMainKotlinMetadata | ||
|
||
build-androidApp: | ||
runs-on: macos-latest | ||
|
@@ -32,20 +32,67 @@ jobs: | |
- name: Build Android App | ||
run: ./gradlew androidApp:build | ||
|
||
build-debug-iosApp: | ||
build-iosApp: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
configuration: [Debug, Release] | ||
target: [iphonesimulator, iphoneos] | ||
needs: build-shared | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-lightsaber-ci | ||
|
||
# Signing Xcode applications | ||
# https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development | ||
- 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: ${{ secrets.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 list-keychain -d user -s $KEYCHAIN_PATH | ||
# apply provisioning profile | ||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | ||
- name: Shared Pod Install | ||
run: ./gradlew shared:podInstall | ||
run: ./gradlew podInstall | ||
|
||
- name: Build iOS App | ||
env: | ||
LIGHTSABER_TEAM_ID: ${{ secrets.LIGHTSABER_TEAM_ID }} | ||
run: | | ||
xcodebuild -workspace ${{ github.workspace }}/iosApp/iosApp.xcworkspace \ | ||
-scheme iosApp \ | ||
-configuration ${{ matrix.configuration }} \ | ||
-xcconfig ${{ github.workspace }}/iosApp/Configuration/Config.xcconfig \ | ||
OBJROOT=${{ github.workspace }}/iosApp/build/ios SYMROOT=${{ github.workspace }}/iosApp/build/ios \ | ||
-sdk ${{ matrix.target }} | ||
# TODO Setup xcodebuild command correctly | ||
# - name: Build Debug iOS App | ||
# run: xcodebuild -workspace ./iosApp/iosApp.xcworkspace -scheme iosApp -configuration Debug | | ||
# OBJROOT=./build/ios SYMROOT=./build/ios -arch arm64 -allowProvisioningUpdates | ||
- name: Clean up keychain and provisioning profile | ||
if: ${{ always() }} | ||
run: | | ||
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db | ||
rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision | ||
test-shared: | ||
runs-on: macos-latest | ||
|
@@ -67,4 +114,21 @@ jobs: | |
- uses: mobile-dev-inc/[email protected] | ||
with: | ||
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} | ||
app-file: androidApp/build/outputs/apk/debug/androidApp-debug.apk | ||
app-file: androidApp/build/outputs/apk/debug/androidApp-debug.apk | ||
|
||
e2e-test-iosApp: | ||
runs-on: macos-latest | ||
needs: build-iosApp | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-lightsaber-ci | ||
|
||
|
||
# TODO Run e2e tests when Compose Multiplatform supports either Compose test tags or | ||
# accessibility labels | ||
- name: Check for app file | ||
run: test -e ./iosApp/build/ios/Release-iphonesimulator/Lightsaber.app | ||
# - uses: mobile-dev-inc/[email protected] | ||
# with: | ||
# api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} | ||
# app-file: ./iosApp/build/ios/Release-iphonesimulator/Lightsaber.app |
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
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