From 2a9b11d04282e9a0d90fce6c64ddd7ac0a3c70c0 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com> Date: Tue, 3 Sep 2024 20:14:32 -0400 Subject: [PATCH] Tophat (#6043) * publish artifacts to s3 * publish artifacts to s3 with tophat url * run anywhere * zip before upload * refactor job * rearrange * zip the right folder * fix * missing " * another refactor * fix filename * another refactor * fix naming * username * testing real device * refactor again * force run * more updates * disable cache download * change signing defaults * target CI-9 * add xcode caching * fix aws src syntax * fix paths again * change order of actions * fix path * dont run while in draft * restore app store default profiles * switch profiles before building --- .github/workflows/macstadium-builds.yml | 111 ++++++++++++++++++ ...acstadium-e2e.yml => macstadium-tests.yml} | 69 +++++++---- ios/Rainbow.xcodeproj/project.pbxproj | 54 +++++---- ios/Rainbow/Info.plist | 106 ++++++++--------- ios/fastlane/Fastfile | 60 +++++++++- 5 files changed, 302 insertions(+), 98 deletions(-) create mode 100644 .github/workflows/macstadium-builds.yml rename .github/workflows/{macstadium-e2e.yml => macstadium-tests.yml} (64%) diff --git a/.github/workflows/macstadium-builds.yml b/.github/workflows/macstadium-builds.yml new file mode 100644 index 00000000000..555ec762658 --- /dev/null +++ b/.github/workflows/macstadium-builds.yml @@ -0,0 +1,111 @@ +name: iOS builds +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + workflow_dispatch: + +jobs: + # Job to install dependencies + build: + runs-on: ["self-hosted"] + if: github.event.pull_request.draft == false + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: + contents: read + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up github keys + run: git config core.sshCommand "ssh -i ~/.ssh/id_ed25519 -F /dev/null" + + - name: Clean iOS app + run: yarn clean:ios > /dev/null 2>&1 || true + + - name: Set up ENV vars & scripts + env: + CI_SCRIPTS: ${{ secrets.CI_SCRIPTS }} + run: | + source ~/.zshrc + git clone git@github.com:rainbow-me/rainbow-env.git + mv rainbow-env/dotenv .env && rm -rf rainbow-env + eval $CI_SCRIPTS + + - name: Get Yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - name: Cache Yarn dependencies + uses: actions/cache@v4 + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + .yarn/cache + .yarn/install-state.gz + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: | + yarn install && yarn setup + + - name: Version debug + run: | + npx react-native info + + - name: Install pods + run: yarn install-bundle && yarn install-pods + + - uses: irgaly/xcode-cache@v1 + with: + key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} + restore-keys: xcode-cache-deriveddata-${{ github.workflow }}- + + # TOPHAT iOS SIM + - name: Build the app in release mode for simulator + run: | + sed -i'' -e "s/IS_TESTING=true/IS_TESTING=false/" .env && rm -f .env-e + sed -i '' 's/match AppStore/match AdHoc/g' "ios/Rainbow.xcodeproj/project.pbxproj" + + xcodebuild -workspace ios/Rainbow.xcworkspace -scheme Rainbow -configuration Release -sdk iphonesimulator -derivedDataPath ios/build + APP_DIR=$(find . -name "*.app" | head -n 1) + cd $APP_DIR && zip -r ../../../../../../App.zip . + + # TOPHAT iOS DEVICE + - name: Build the app in release mode for iOS devices + env: + FASTLANE_USER: ${{ secrets.FASTLANE_USER }} + FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + run: | + cd ios && bundle exec fastlane ios build_device + - name: Upload builds to AWS S3 + env: + AWS_BUCKET: rainbow-app-team-production + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + COMMIT_HASH: ${{ github.sha }} + run: | + APP_FILE=$(find . -name "App.zip" | head -n 1) + aws s3 cp "${APP_FILE}" "s3://${AWS_BUCKET}/${BRANCH_NAME}/${COMMIT_HASH}.app.zip" + IPA_FILE=./ios/build/Rainbow.ipa + aws s3 cp "${IPA_FILE}" "s3://${AWS_BUCKET}/${BRANCH_NAME}/${COMMIT_HASH}.ipa" + + - name: Post comment to PR + if: github.event_name == 'pull_request' + env: + TOPHAT_GITHUB_TOKEN: ${{ secrets.TOPHAT_GITHUB_TOKEN }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + COMMIT_HASH: ${{ github.sha }} + run: | + COMMENT="Launch in [simulator](http://localhost:29070/install/ios?virtual=https://app-team.p.rainbow.me/${BRANCH_NAME}/${COMMIT_HASH}.app.zip) or [device](http://localhost:29070/install/ios?physical=https://app-team.p.rainbow.me/${BRANCH_NAME}/${COMMIT_HASH}.ipa) for ${COMMIT_HASH}" + curl -s -H "Authorization: token $TOPHAT_GITHUB_TOKEN" -X POST \ + -d "{\"body\":\"$COMMENT\"}" \ + "${{ github.event.pull_request.comments_url }}" + + + diff --git a/.github/workflows/macstadium-e2e.yml b/.github/workflows/macstadium-tests.yml similarity index 64% rename from .github/workflows/macstadium-e2e.yml rename to .github/workflows/macstadium-tests.yml index fd826523eaa..dae6d82cc72 100644 --- a/.github/workflows/macstadium-e2e.yml +++ b/.github/workflows/macstadium-tests.yml @@ -1,16 +1,15 @@ name: iOS e2e tests - on: [pull_request, workflow_dispatch] + jobs: - ios-e2e: + # Job to install dependencies + install-deps: runs-on: ["self-hosted"] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - permissions: contents: read - steps: - name: Checkout repo uses: actions/checkout@v4 @@ -29,8 +28,7 @@ jobs: git clone git@github.com:rainbow-me/rainbow-env.git mv rainbow-env/dotenv .env && rm -rf rainbow-env eval $CI_SCRIPTS - sed -i'' -e "s/IS_TESTING=false/IS_TESTING=true/" .env && rm -f .env-e - + - name: Get Yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT @@ -48,7 +46,26 @@ jobs: - name: Install dependencies run: | - yarn cache clean --all && yarn install && yarn setup + yarn install && yarn setup + + - name: Upload Yarn cache + uses: actions/upload-artifact@v3 + with: + name: yarn-cache + path: | + .yarn/cache + .yarn/install-state.gz + + # Job for linting and unit tests + linting-and-unit-tests: + runs-on: ["self-hosted"] + needs: install-deps + steps: + - name: Download Yarn cache + uses: actions/download-artifact@v3 + with: + name: yarn-cache + path: .yarn - name: Check for frozen lockfile run: ./scripts/check-lockfile.sh @@ -62,24 +79,36 @@ jobs: - name: Unit tests run: yarn test + # iOS build and e2e tests + e2e-ios: + runs-on: ["self-hosted"] + needs: install-deps + steps: + - name: Download Yarn cache + uses: actions/download-artifact@v3 + with: + name: yarn-cache + path: .yarn + - name: Rebuild detox cache run: ./node_modules/.bin/detox clean-framework-cache && ./node_modules/.bin/detox build-framework-cache - + - name: Version debug run: | npx react-native info - + - name: Install pods run: yarn install-bundle && yarn install-pods - - - name: Fix permissions - run: | - chmod -R +x node_modules/react-native/scripts - chmod -R +x node_modules/@sentry/react-native/scripts - - - name: Build the app in release mode - run: yarn detox build --configuration ios.sim.release - - # change the '3' here to how many times you want the tests to rerun on failure + + - uses: irgaly/xcode-cache@v1 + with: + key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} + restore-keys: xcode-cache-deriveddata-${{ github.workflow }}- + + # Detox iOS e2e tests - name: Run iOS e2e tests with retry - run: ./scripts/run-retry-tests.sh 3 + run: | + sed -i'' -e "s/IS_TESTING=false/IS_TESTING=true/" .env && rm -f .env-e + yarn detox build --configuration ios.sim.release + ./scripts/run-retry-tests.sh 3 + \ No newline at end of file diff --git a/ios/Rainbow.xcodeproj/project.pbxproj b/ios/Rainbow.xcodeproj/project.pbxproj index e586a215e55..f7203347248 100644 --- a/ios/Rainbow.xcodeproj/project.pbxproj +++ b/ios/Rainbow.xcodeproj/project.pbxproj @@ -1652,12 +1652,14 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = L74NQAQB8H; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = L74NQAQB8H; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; @@ -1671,7 +1673,8 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = me.rainbow.ImageNotification; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.rainbow.ImageNotification"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore me.rainbow.ImageNotification"; SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; @@ -1864,11 +1867,13 @@ ASSETCATALOG_COMPILER_OPTIMIZATION = ""; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Rainbow/RainbowRelease.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = L74NQAQB8H; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = L74NQAQB8H; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( @@ -1905,7 +1910,8 @@ PRODUCT_BUNDLE_IDENTIFIER = me.rainbow; PRODUCT_NAME = Rainbow; PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.rainbow"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore me.rainbow"; SWIFT_OBJC_BRIDGING_HEADER = "Rainbow-Bridging-Header.h"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; SWIFT_VERSION = 5.0; @@ -2331,11 +2337,13 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = PriceWidgetExtension.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = L74NQAQB8H; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = L74NQAQB8H; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; @@ -2345,7 +2353,8 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = me.rainbow.PriceWidget; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.rainbow.PriceWidget"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore me.rainbow.PriceWidget"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; @@ -2425,8 +2434,8 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = PriceWidgetExtension.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = L74NQAQB8H; @@ -2439,7 +2448,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = me.rainbow.PriceWidget; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.rainbow.PriceWidget"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; @@ -2517,11 +2526,13 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = SelectTokenIntent/SelectTokenIntent.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = L74NQAQB8H; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = L74NQAQB8H; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; @@ -2531,7 +2542,8 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = me.rainbow.SelectTokenIntent; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.rainbow.SelectTokenIntent"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore me.rainbow.SelectTokenIntent"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; @@ -2607,8 +2619,8 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = SelectTokenIntent/SelectTokenIntent.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = L74NQAQB8H; @@ -2621,7 +2633,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = me.rainbow.SelectTokenIntent; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.rainbow.SelectTokenIntent"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; @@ -2711,7 +2723,8 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -2929,7 +2942,8 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; diff --git a/ios/Rainbow/Info.plist b/ios/Rainbow/Info.plist index 91736a5af8d..8273cab6e66 100644 --- a/ios/Rainbow/Info.plist +++ b/ios/Rainbow/Info.plist @@ -2,8 +2,6 @@ - RCTAsyncStorageExcludeFromBackup - CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion @@ -16,122 +14,122 @@ CFBundleAlternateIcons - pooly + adworld - UIPrerenderedIcon - CFBundleIconFiles - pooly + adworld - - poolboy - UIPrerenderedIcon - CFBundleIconFiles - - poolboy - - smol + farcaster - UIPrerenderedIcon - CFBundleIconFiles - smol + farcaster - - raindoge - UIPrerenderedIcon + + finiliar + CFBundleIconFiles - raindoge + finiliar + UIPrerenderedIcon + golddoge - UIPrerenderedIcon - CFBundleIconFiles golddoge - - pixel - UIPrerenderedIcon + + og + CFBundleIconFiles - pixel + og + UIPrerenderedIcon + optimism - UIPrerenderedIcon - CFBundleIconFiles optimism - - zora - UIPrerenderedIcon + + pixel + CFBundleIconFiles - zora + pixel - - finiliar - UIPrerenderedIcon + + poolboy + CFBundleIconFiles - finiliar + poolboy - - zorb - UIPrerenderedIcon + + pooly + CFBundleIconFiles - zorb + pooly - - farcaster - UIPrerenderedIcon + + raindoge + CFBundleIconFiles - farcaster + raindoge - - adworld - UIPrerenderedIcon + + smol + CFBundleIconFiles - adworld + smol + UIPrerenderedIcon + - og + zora + CFBundleIconFiles + + zora + UIPrerenderedIcon + + zorb + CFBundleIconFiles - og + zorb + UIPrerenderedIcon + CFBundlePrimaryIcon @@ -192,6 +190,8 @@ NSAllowsLocalNetworking + NSBluetoothAlwaysUsageDescription + This allows Rainbow to find and pair a Ledger Nano X NSCameraUsageDescription This lets you scan QR codes for connecting to dApps and discovering wallets NSFaceIDUsageDescription @@ -200,8 +200,6 @@ This allows Rainbow to save images to your Camera Roll NSPhotoLibraryUsageDescription This allows Rainbow to display selected photos as avatars across each of your wallet addresses - NSBluetoothAlwaysUsageDescription - This allows Rainbow to find and pair a Ledger Nano X NSUbiquitousContainers iCloud.me.rainbow @@ -218,6 +216,8 @@ SelectTokenIntent + RCTAsyncStorageExcludeFromBackup + UIAppFonts SF-Mono-Bold.otf diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index a3191ae123b..eafd2c4db2c 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -23,10 +23,6 @@ platform :ios do duration: 1200, # optional in_house: false, # optional but may be required if using match/sigh ) - - upload_symbols_to_crashlytics( - dsym_path: './Rainbow.app.dSYM.zip' - ) end desc "Submit a new Beta build to Apple TestFlight" @@ -67,7 +63,18 @@ platform :ios do scheme: "Rainbow", include_symbols: true, configuration: "Release", - export_method: "app-store" + export_method: "app-store", + export_options: { + signingStyle: "manual", + provisioningProfiles: { + "me.rainbow" => "match AppStore me.rainbow", + "me.rainbow.PriceWidget" => "match AppStore me.rainbow.PriceWidget", + "me.rainbow.SelectTokenIntent" => "match AppStore me.rainbow.SelectTokenIntent", + "me.rainbow.ImageNotification" => "match AppStore me.rainbow.ImageNotification", + "me.rainbow.OpenInRainbow" => "match AppStore me.rainbow.OpenInRainbow", + "me.rainbow.ShareWithRainbow" => "match AppStore me.rainbow.ShareWithRainbow", + }, + } ) pilot( @@ -77,4 +84,47 @@ platform :ios do ) end + desc "Create new build for iOS devices in release mode" + lane :build_device do + + update_info_plist( + plist_path: "Rainbow/Info.plist", + display_name: "Rainbow" + ) + + update_app_identifier( + app_identifier: "me.rainbow", + xcodeproj: "Rainbow.xcodeproj", + plist_path: "Rainbow/Info.plist", + ) + + match( + force: true, + type: "adhoc", + app_identifier: ["me.rainbow", "me.rainbow.PriceWidget", "me.rainbow.SelectTokenIntent", "me.rainbow.ImageNotification", "me.rainbow.OpenInRainbow", "me.rainbow.ShareWithRainbow"], + git_url: "git@github.com:rainbow-me/rainbow-code-signing.git", + ) + + gym( + workspace: "Rainbow.xcworkspace", + scheme: "Rainbow", + include_symbols: false, + export_method: "ad-hoc", + output_directory: "build", + output_name: "Rainbow.ipa", + archive_path: "build/Rainbow.xcarchive", + export_options: { + signingStyle: "manual", + provisioningProfiles: { + "me.rainbow" => "match AdHoc me.rainbow", + "me.rainbow.PriceWidget" => "match AdHoc me.rainbow.PriceWidget", + "me.rainbow.SelectTokenIntent" => "match AdHoc me.rainbow.SelectTokenIntent", + "me.rainbow.ImageNotification" => "match AdHoc me.rainbow.ImageNotification", + "me.rainbow.OpenInRainbow" => "match AdHoc me.rainbow.OpenInRainbow", + "me.rainbow.ShareWithRainbow" => "match AdHoc me.rainbow.ShareWithRainbow", + }, + } + ) + + end end