From 845cc196adc68e3b9c1a8c76af5a40b745304582 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Tue, 12 Sep 2023 15:49:30 +0100 Subject: [PATCH] Fix package.json build scripts to target correct dir for building from metro config + update workflows and fastlane --- ...w.yml => android-build-and-distribute.yml} | 2 +- .github/workflows/ios-browserstack.yml | 2 +- ...etize.yml => ios-build-and-distribute.yml} | 5 +- .github/workflows/ios-preview.yml | 52 ------------------- fastlane/AndroidFastFile | 2 +- fastlane/Fastfile | 17 +----- package.json | 4 +- 7 files changed, 9 insertions(+), 75 deletions(-) rename .github/workflows/{android-preview.yml => android-build-and-distribute.yml} (98%) rename .github/workflows/{ios-appetize.yml => ios-build-and-distribute.yml} (98%) delete mode 100644 .github/workflows/ios-preview.yml diff --git a/.github/workflows/android-preview.yml b/.github/workflows/android-build-and-distribute.yml similarity index 98% rename from .github/workflows/android-preview.yml rename to .github/workflows/android-build-and-distribute.yml index 386b09eb6..2a1ad1a83 100644 --- a/.github/workflows/android-preview.yml +++ b/.github/workflows/android-build-and-distribute.yml @@ -41,7 +41,7 @@ jobs: yarn - name: Distribute the React Native Android app on Appetize and upload to BrowserStack 🚀 - run: bundle exec fastlane android upload_build_to_appetize_android + run: bundle exec fastlane android appetize_build_and_upload env: PR_NUMBER: ${{ github.event.pull_request.number }} SOURCE_BRANCH: ${{ github.head_ref }} diff --git a/.github/workflows/ios-browserstack.yml b/.github/workflows/ios-browserstack.yml index 701226ef2..18e4f8a72 100644 --- a/.github/workflows/ios-browserstack.yml +++ b/.github/workflows/ios-browserstack.yml @@ -95,7 +95,7 @@ jobs: - name: Create main.jsbundle run: | - npm run build:ios:release + yarn --cwd example build:ios - name: Build and upload to Browserstack 🚀 run: | diff --git a/.github/workflows/ios-appetize.yml b/.github/workflows/ios-build-and-distribute.yml similarity index 98% rename from .github/workflows/ios-appetize.yml rename to .github/workflows/ios-build-and-distribute.yml index 157e91be9..e38c08267 100644 --- a/.github/workflows/ios-appetize.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -89,10 +89,11 @@ jobs: - name: Create main.jsbundle run: | - npm run build:ios:dev + yarn --cwd example build:ios + - name: Distribute the React Native iOS app on Appetize 🚀 run: | - bundle exec fastlane ios upload_build_to_appetize_ios + bundle exec fastlane ios appetize_build_and_upload env: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} diff --git a/.github/workflows/ios-preview.yml b/.github/workflows/ios-preview.yml deleted file mode 100644 index fcde47e5a..000000000 --- a/.github/workflows/ios-preview.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Preview - -on: pull_request - -jobs: - distribute-ios: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - - name: Install SSH key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.SSH_KEY }} - name: id_rsa_github_actions - known_hosts: unnecessary - - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "2.6" - bundler-cache: true - - - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install packages - run: | - yarn - - - name: Preview app on Appetize 🚀 - run: bundle exec fastlane ios preview - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - SOURCE_BRANCH: ${{ github.head_ref }} - APPETIZE_API_TOKEN: ${{ secrets.APPETIZE_API_TOKEN }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} diff --git a/fastlane/AndroidFastFile b/fastlane/AndroidFastFile index eb0cccfb7..bc9e95b3f 100644 --- a/fastlane/AndroidFastFile +++ b/fastlane/AndroidFastFile @@ -36,7 +36,7 @@ platform :android do return s[re, 1] end - lane :preview do + lane :appetize_build_and_upload do pr_number = ENV["PR_NUMBER"] if(!pr_number) then puts "NO PR NUMBER" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5f2829410..22c682c2e 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,15 +1,2 @@ -platform :ios do - import "IOSFastFile" - desc 'Upload the React Native Android build to Appetize' - lane :upload_build_to_appetize_ios do - appetize_build_and_upload - end -end - -platform :android do - import "AndroidFastFile" - desc 'Upload the React Native Android build to Appetize' - lane :upload_build_to_appetize_android do - preview - end -end +import "IOSFastFile" +import "AndroidFastFile" \ No newline at end of file diff --git a/package.json b/package.json index 0137a7e43..891b8070a 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,7 @@ "release": "release-it", "example": "yarn --cwd example", "pods": "cd example && pod-install --quiet", - "bootstrap": "yarn example && yarn && yarn pods", - "build:ios:dev": "react-native bundle --entry-file='index.js' --bundle-output='./example/ios/main.jsbundle' --dev=true --platform='ios'", - "build:ios:release": "react-native bundle --entry-file='index.js' --bundle-output='./example/ios/main.jsbundle' --dev=false --platform='ios'" + "bootstrap": "yarn example && yarn && yarn pods" }, "keywords": [ "react-native",