From 0f6aabcc18255302a1c2bcf40b2a4cde15fb67d4 Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Sun, 28 Apr 2024 13:35:30 -0400 Subject: [PATCH] Lock React version to ~18.2.0 (#1148) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lock React version to ~18.2.0 React 19 and React 18.3 are out (https://react.dev/blog/2024/04/25/react-19-upgrade-guide#react-18-3), but the React Native ecosystem is still on React 18.2. We need to lock the versions down until the React Native packages update. * 💩 Temporarily pin the version to 14.1 so that the CI is successful Consisent with https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2079688203 * 💩 Revert back even further to xcode 14 Consistent with https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2080155690 * 📌 Ensure that we are using the correct version of java Before this, we set only the `JAVA_HOME` to pin the java version This was working until a couple of days ago, when, even after setting the version, the java version was not changed. This may be due to the location for the java executable changing, so let's try to set the PATH as well Also print out several environment variables to help debug further Related info: https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2079702274 https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2080155690 * 🔧 Change the environment variable to the one used in the new github actions runner Related context: https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2081318853 * 📌 Pin the mac version to 13 To be consistent with https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2081318853 Before we fix https://github.com/e-mission/e-mission-docs/issues/1060 * 📌 Pin the mac version to 13 Consistent with https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2081323518 and https://github.com/e-mission/e-mission-phone/pull/1148/commits/b5072f351e7954d0ffef9d7d55a5751b225813e2 (for iOS) * ⏪️ Revert previous attempts to fix the issue since pinning to OSX-13 fixed it https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2081331221 * 📌 Pin the xcode version again Because apparently the default version, even on the OSX 13 runner, is now xcode 15 https://github.com/e-mission/e-mission-phone/pull/1148#issuecomment-2081536981 * Ensure that the switch command is run as root --------- Co-authored-by: K. Shankari --- .github/workflows/android-build.yml | 6 +++++- .github/workflows/ios-build.yml | 8 +++++++- package.cordovabuild.json | 6 +++--- package.serve.json | 7 ++++--- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 25eb65317..90c75d147 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -22,13 +22,17 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: macos-latest + runs-on: macos-13 # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + # Runs a single command using the runners shell + - name: Prints related environment variables so that we can know what to set + run: env | egrep "JAVA|PATH|ANDROID" + # Runs a single command using the runners shell - name: Print the java and gradle versions run: | diff --git a/.github/workflows/ios-build.yml b/.github/workflows/ios-build.yml index ad0ce2f01..ac6bb76f3 100644 --- a/.github/workflows/ios-build.yml +++ b/.github/workflows/ios-build.yml @@ -22,7 +22,7 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: macos-latest + runs-on: macos-13 # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -33,6 +33,12 @@ jobs: - name: Print the xcode path run: xcode-select --print-path + - name: Set xcode to 14.1 + run: | + sudo xcode-select --switch /Applications/Xcode_14.1.app + echo "After setting xcode version "`xcode-select --print-path` + + - name: Print the xcode setup run: xcodebuild -version -sdk diff --git a/package.cordovabuild.json b/package.cordovabuild.json index c3f7ec8d3..85ebd6eb9 100644 --- a/package.cordovabuild.json +++ b/package.cordovabuild.json @@ -26,7 +26,7 @@ "@babel/preset-typescript": "^7.21.4", "@ionic/cli": "6.20.8", "@types/luxon": "^3.3.0", - "@types/react": "^18.2.20", + "@types/react": "~18.2.0", "babel-loader": "^9.1.2", "babel-plugin-optional-require": "^0.3.1", "concurrently": "^8.0.1", @@ -152,9 +152,9 @@ "npm": "^9.6.3", "phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0", "prop-types": "^15.8.1", - "react": "^18.2.*", + "react": "~18.2.0", "react-chartjs-2": "^5.2.0", - "react-dom": "^18.2.*", + "react-dom": "~18.2.0", "react-i18next": "^13.5.0", "react-native-paper": "^5.11.0", "react-native-paper-dates": "^0.18.12", diff --git a/package.serve.json b/package.serve.json index dceeb2267..f6f5c2ae3 100644 --- a/package.serve.json +++ b/package.serve.json @@ -26,7 +26,7 @@ "@ionic/cli": "6.20.8", "@testing-library/react-native": "^12.3.0", "@types/luxon": "^3.3.0", - "@types/react": "^18.2.20", + "@types/react": "~18.2.0", "babel-jest": "^29.7.0", "babel-loader": "^9.1.2", "babel-plugin-optional-require": "^0.3.1", @@ -40,6 +40,7 @@ "jest-environment-jsdom": "^29.7.0", "phonegap": "9.0.0+cordova.9.0.0", "process": "^0.11.10", + "react-test-renderer": "~18.2.0", "sass": "^1.62.1", "sass-loader": "^13.3.1", "style-loader": "^3.3.3", @@ -76,9 +77,9 @@ "luxon": "^3.3.0", "npm": "^9.6.3", "prop-types": "^15.8.1", - "react": "^18.2.*", + "react": "~18.2.0", "react-chartjs-2": "^5.2.0", - "react-dom": "^18.2.*", + "react-dom": "~18.2.0", "react-i18next": "^13.5.0", "react-native-paper": "^5.11.0", "react-native-paper-dates": "^0.18.12",