From fd0aa1a6f033a255f65dbe266d1fa69f96baf121 Mon Sep 17 00:00:00 2001 From: Michael Lustig Date: Fri, 20 Dec 2024 15:42:54 -0500 Subject: [PATCH 1/6] fix: eas build failed after changing ruby versions --- ios/Gemfile | 7 +++++-- ios/Gemfile.lock | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ios/Gemfile b/ios/Gemfile index 1b3b350e3..280ebb06a 100644 --- a/ios/Gemfile +++ b/ios/Gemfile @@ -1,7 +1,10 @@ source 'https://rubygems.org' -# Specify minimum bundler version for Ruby 3.3.x compatibility -gem 'bundler', '>= 2.4.0' +# Specify Ruby version for compatibility +ruby '~> 3.3.0' + +# Specify bundler version that works with Ruby 3.3 +gem 'bundler', '~> 2.6.1' gem 'cocoapods' gem 'cocoapods-pod-linkage' diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 42cc32bd8..4c24ca24e 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -116,9 +116,12 @@ PLATFORMS DEPENDENCIES activesupport (>= 6.1.7.3, < 7.1.0) - bundler (>= 2.4.0) + bundler (~> 2.6.1) cocoapods cocoapods-pod-linkage +RUBY VERSION + ruby 3.3.5p100 + BUNDLED WITH 2.6.1 From fb913fb6e1e66f8d7ddea548188393b68d2b777a Mon Sep 17 00:00:00 2001 From: Michael Lustig Date: Fri, 20 Dec 2024 16:08:36 -0500 Subject: [PATCH 2/6] try using prebuilt image with appropriate ruby versions https://docs.expo.dev/build-reference/infrastructure/#ios-server-images iOS server images macos-sonoma-14.6-xcode-16.1 ( latest , sdk-52 ) Details macOS Sonoma 14.6 Xcode 16.1 (16B40) Node.js 18.18.0 Bun 1.1.33 Yarn 1.22.21 pnpm 9.12.3 npm 9.8.1 fastlane 2.225.0 CocoaPods 1.16.2 Ruby 3.2 node-gyp 10.2.0 --- eas.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eas.json b/eas.json index a958cd60b..51d02e0ee 100644 --- a/eas.json +++ b/eas.json @@ -43,7 +43,8 @@ "EXPO_ENV": "preview" }, "ios": { - "resourceClass": "medium" + "resourceClass": "medium", + "image": "macos-sonoma-14.6-xcode-16.1" } }, "preview-android": { From f5fbc3333202958581b3b8ad29194e97f2fa5c9e Mon Sep 17 00:00:00 2001 From: Michael Lustig Date: Fri, 20 Dec 2024 17:06:33 -0500 Subject: [PATCH 3/6] specify dependencies used in eas build images --- ios/Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Gemfile b/ios/Gemfile index 280ebb06a..c528f899e 100644 --- a/ios/Gemfile +++ b/ios/Gemfile @@ -1,10 +1,10 @@ source 'https://rubygems.org' # Specify Ruby version for compatibility -ruby '~> 3.3.0' +ruby '~> 3.2.5' # Specify bundler version that works with Ruby 3.3 -gem 'bundler', '~> 2.6.1' +gem 'bundler', '~> 2.5.16' gem 'cocoapods' gem 'cocoapods-pod-linkage' From 53af377a9cafa28997b683a1fbc5a140a06d0065 Mon Sep 17 00:00:00 2001 From: Michael Lustig Date: Fri, 20 Dec 2024 17:25:59 -0500 Subject: [PATCH 4/6] specify eas dependencies for local builds more specifically --- .ruby-version | 1 + ios/Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..5ae69bd5f --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.5 diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 4c24ca24e..f9941c3b3 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -116,12 +116,12 @@ PLATFORMS DEPENDENCIES activesupport (>= 6.1.7.3, < 7.1.0) - bundler (~> 2.6.1) + bundler (~> 2.5.16) cocoapods cocoapods-pod-linkage RUBY VERSION - ruby 3.3.5p100 + ruby 3.2.5p208 BUNDLED WITH - 2.6.1 + 2.5.23 From d79fe09ac22b86db2923a377bcafce2cfef82450 Mon Sep 17 00:00:00 2001 From: Michael Lustig Date: Fri, 20 Dec 2024 17:39:35 -0500 Subject: [PATCH 5/6] add versioning and clean script --- package.json | 2 + scripts/ios/checkBuildDeps.sh | 77 ++++++++++++++++++++++++++++++++ scripts/reactNativeCleanBuild.sh | 44 ++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100755 scripts/ios/checkBuildDeps.sh create mode 100755 scripts/reactNativeCleanBuild.sh diff --git a/package.json b/package.json index fe5c8b12f..57fec743a 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,13 @@ "android:reverse": "adb reverse tcp:8081 tcp:8081 && adb reverse tcp:9875 tcp:9875", "android:sendApk": "./scripts/android/sendApk.sh", "build": "node scripts/build/build.js", + "clean": "./scripts/reactNativeCleanBuild.sh", "commit": "git show --format=\"%h\" --no-patch", "db": "ts-node scripts/migrations/db.ts", "lint": "eslint --max-warnings 2500", "lint:errors": "eslint --quiet", "ios": "expo run:ios", + "ios:checkBuildDeps": "./scripts/ios/checkBuildDeps.sh", "run:ios": "EXPO_ENV=dev expo run:ios", "postinstall": "patch-package && node scripts/wasm.js && husky install && cross-os postinstall", "start": "EXPO_ENV=dev expo start --scheme converse-dev", diff --git a/scripts/ios/checkBuildDeps.sh b/scripts/ios/checkBuildDeps.sh new file mode 100755 index 000000000..eb07ba298 --- /dev/null +++ b/scripts/ios/checkBuildDeps.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +# ANSI color codes +GREEN='\033[0;32m' +RED='\033[0;31m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color +BOLD='\033[1m' + +# Function to check if a command exists +command_exists() { + command -v "$1" >/dev/null 2>&1 +} + +# Function to print status +print_status() { + local name=$1 + local version=$2 + local path=$3 + local status=$4 + + printf "${BOLD}%-12s${NC}" "$name" + + if [ "$status" = "OK" ]; then + printf "${GREEN}✓${NC} " + else + printf "${RED}✗${NC} " + fi + + printf "%-45s" "$version" + echo "$path" +} + +echo -e "\n${BOLD}Checking iOS build dependencies...${NC}\n" + +# Check Ruby +if command_exists ruby; then + RUBY_VERSION=$(ruby -v) + RUBY_PATH=$(which ruby) + print_status "RUBY" "$RUBY_VERSION" "$RUBY_PATH" "OK" +else + print_status "RUBY" "Not installed" "N/A" "ERROR" +fi + +# Check Bundler +if command_exists bundle; then + BUNDLER_VERSION=$(bundle -v) + BUNDLER_PATH=$(which bundle) + print_status "BUNDLER" "$BUNDLER_VERSION" "$BUNDLER_PATH" "OK" +else + print_status "BUNDLER" "Not installed" "N/A" "ERROR" +fi + +# Check CocoaPods +if command_exists pod; then + POD_VERSION=$(pod --version) + POD_PATH=$(which pod) + print_status "COCOAPODS" "v$POD_VERSION" "$POD_PATH" "OK" +else + print_status "COCOAPODS" "Not installed" "N/A" "ERROR" +fi + +# Print Gem environment +echo -e "\n${BOLD}Ruby Gem Environment:${NC}" +echo "GEM HOME: $(gem env home)" +echo "GEM PATH: $(gem env gempath)" + +# Check Gemfile configuration +if [ -f "ios/Gemfile" ]; then + echo -e "\n${BOLD}Gemfile Configuration:${NC}" + echo "Ruby Version: $(grep "ruby '" ios/Gemfile | cut -d"'" -f2)" + echo "Bundler Version: $(grep "bundler" ios/Gemfile | grep -v "#" | head -n1)" +else + echo -e "\n${RED}Warning: ios/Gemfile not found${NC}" +fi + +echo -e "\nDone checking dependencies.\n" \ No newline at end of file diff --git a/scripts/reactNativeCleanBuild.sh b/scripts/reactNativeCleanBuild.sh new file mode 100755 index 000000000..65356ad51 --- /dev/null +++ b/scripts/reactNativeCleanBuild.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +############################################################### +# Quickly cleans and rebuilds a React Native project by moving +# build directories to Trash and reinstalling dependencies. +# +# Uses AppleScript for fast native Trash operations, similar +# to Cmd+Delete in Finder. This is much faster than rm -rf. +# +# Side Effects: +# - Moves node_modules, ios/build, ios/Pods to Trash +# - Runs yarn install +# - Runs pod install for iOS +# - Prints status messages to terminal +# +# Example: +# In terminal from project root: +# ./scripts/reactNativeCleanBuild.sh +# +# Output: +# Moving node_modules to trash... +# Moving ios/build to trash... +# Moving ios/Pods to trash... +# Running yarn install... +# Running pod install... +# Clean and rebuild complete! +############################################################### + +echo "Moving node_modules to trash..." +osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/node_modules\"" + +echo "Moving ios/build to trash..." +osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/build\"" + +echo "Moving ios/Pods to trash..." +osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/Pods\"" + +echo "Running yarn install..." +yarn install + +echo "Running pod install..." +cd ios && pod install && cd .. + +echo "Clean and rebuild complete!" \ No newline at end of file From c6fea5911337cec40fee3bbcc6bd0d588b2504e7 Mon Sep 17 00:00:00 2001 From: Alex Risch Date: Sat, 21 Dec 2024 08:31:50 -0500 Subject: [PATCH 6/6] Update Ruby Update Ruby install steps Update dev client builds Update dev client builds Update build checks to use eas dev build instead Remove build output Update build machines fix builds --- .github/workflows/check-android-build.yml | 25 +---------------------- .github/workflows/check-ios-build.yml | 23 ++------------------- eas.json | 11 +++++----- ios/Gemfile | 2 +- 4 files changed, 10 insertions(+), 51 deletions(-) diff --git a/.github/workflows/check-android-build.yml b/.github/workflows/check-android-build.yml index d5aa9df56..4ca54e641 100644 --- a/.github/workflows/check-android-build.yml +++ b/.github/workflows/check-android-build.yml @@ -16,29 +16,12 @@ jobs: - name: Setup repo uses: actions/checkout@v4 - - name: Clean Android Device - # https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Setup node uses: actions/setup-node@v4.0.2 with: node-version: 20.x cache: "yarn" - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: "17" - distribution: "temurin" - - - name: Setup Android SDK - uses: android-actions/setup-android@v3 - - name: 🏗 Setup EAS uses: expo/expo-github-action@v8 with: @@ -49,10 +32,4 @@ jobs: run: yarn install - name: Build Android app - run: eas build --platform android --profile development --local --output ${{ github.workspace }}/app-release.apk - - - name: Upload APK artifact - uses: actions/upload-artifact@v4 - with: - name: app-release - path: ${{ github.workspace }}/app-release.apk + run: eas build --profile development --platform android --non-interactive diff --git a/.github/workflows/check-ios-build.yml b/.github/workflows/check-ios-build.yml index 00897e342..4829738a9 100644 --- a/.github/workflows/check-ios-build.yml +++ b/.github/workflows/check-ios-build.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: ubuntu-latest steps: - name: Setup repo uses: actions/checkout@v4 @@ -31,25 +31,6 @@ jobs: - name: Install dependencies run: | yarn install - yarn cache clean - - - name: Free up disk space - run: | - sudo rm -rf ~/Library/Developer/Xcode/DerivedData/* - sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/* - sudo rm -rf ~/Library/Developer/CoreSimulator/Devices/* - sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/* - name: Build iOS app - run: eas build --profile ios-simulator --platform ios --local --non-interactive --output ${{ github.workspace }}/app-release.ipa - - - name: Clean up Derived Data and Cache - run: | - rm -rf ~/Library/Developer/Xcode/DerivedData/* - rm -rf ~/Library/Caches/expo/* - - - name: Upload IPA artifact - uses: actions/upload-artifact@v4 - with: - name: app-release - path: ${{ github.workspace }}/app-release.ipa + run: eas build --profile ios-simulator --platform ios --non-interactive diff --git a/eas.json b/eas.json index 51d02e0ee..7a29c76c1 100644 --- a/eas.json +++ b/eas.json @@ -13,10 +13,11 @@ }, "node": "20.15.1", "ios": { - "cocoapods": "1.16.2" + "cocoapods": "1.16.2", + "image": "macos-sonoma-14.6-xcode-16.1" }, "android": { - "resourceClass": "medium" + "resourceClass": "large" } }, "production": { @@ -29,7 +30,8 @@ "node": "20.15.1", "ios": { "resourceClass": "large", - "cocoapods": "1.16.2" + "cocoapods": "1.16.2", + "image": "macos-sonoma-14.6-xcode-16.1" } }, "production-android": { @@ -43,8 +45,7 @@ "EXPO_ENV": "preview" }, "ios": { - "resourceClass": "medium", - "image": "macos-sonoma-14.6-xcode-16.1" + "resourceClass": "medium" } }, "preview-android": { diff --git a/ios/Gemfile b/ios/Gemfile index c528f899e..f5a79bef3 100644 --- a/ios/Gemfile +++ b/ios/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # Specify Ruby version for compatibility -ruby '~> 3.2.5' +ruby '~> 3.2.5' # If you are updating this, update the version in the .ruby-version file # Specify bundler version that works with Ruby 3.3 gem 'bundler', '~> 2.5.16'