From 214e540044396f90c60ab1ac4d7fdd116f7daf27 Mon Sep 17 00:00:00 2001 From: Ranesh Saha Date: Mon, 11 Jul 2022 10:06:49 -0700 Subject: [PATCH] Publish rn-tester apks and bundle to build artifacts --- .ado/android-pr.yml | 26 ---------------- .ado/publish.yml | 15 +++------- .ado/templates/android-build-office.yml | 40 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/.ado/android-pr.yml b/.ado/android-pr.yml index 2fa6ba1be1fdb1..6bd4ea57917655 100644 --- a/.ado/android-pr.yml +++ b/.ado/android-pr.yml @@ -31,32 +31,6 @@ jobs: - template: templates/android-build-office.yml - - task: CmdLine@2 - displayName: Remove RNTesterApp.android.bundle - inputs: - script: rm -f ./packages/rn-tester/js/RNTesterApp.android.bundle - - - task: CmdLine@2 - displayName: Create RNTester bundle - inputs: - script: node cli.js bundle --entry-file ./packages/rn-tester/js/RNTesterApp.android.js --bundle-output ./packages/rn-tester/js/RNTesterApp.android.bundle --platform android - - - task: CmdLine@2 - displayName: gradlew installArchives - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs" - - # We have separate tasks to build rn-tester for debug and release due to a regression upstream. See https://github.com/facebook/react-native/issues/34168. - - task: CmdLine@2 - displayName: Build rn-tester debug - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew :packages:rn-tester:android:app:assembleDebug - - - task: CmdLine@2 - displayName: Build rn-tester release - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew :packages:rn-tester:android:app:assembleRelease - - template: templates/prep-android-nuget.yml - template: templates/download-android-dependencies.yml diff --git a/.ado/publish.yml b/.ado/publish.yml index 45646854bcad41..0786e1fb0fe55e 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -218,19 +218,12 @@ jobs: inputs: script: node .ado/removeWorkspaceConfig.js - - task: CmdLine@2 - displayName: gradlew installArchives - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs" - - - template: templates\prep-android-nuget.yml + - template: templates/prep-android-nuget.yml # Enumerate and download all dependencies .. - - task: CmdLine@2 - displayName: 'Verify Dependencies can be enumerated' - inputs: - script: sudo apt-get install python3-pip && sudo apt-get install python3-setuptools && pip3 install BeautifulSoup4 && pip3 install wheel && pip3 install wget && python3 .ado/downloadAndroidDependencies.py $(Build.SourcesDirectory) && tree $(Build.SourcesDirectory)/android - + - template: templates/download-android-dependencies.yml + parameters: + artifact_feed: react-native/react-native-public # Very similar to the default pack task .. but appends 'ndk21b' to the nuget pack version - task: CmdLine@2 diff --git a/.ado/templates/android-build-office.yml b/.ado/templates/android-build-office.yml index e09f41670b1ca8..d51a2eae2a9816 100644 --- a/.ado/templates/android-build-office.yml +++ b/.ado/templates/android-build-office.yml @@ -55,3 +55,43 @@ steps: displayName: Setup Build Dependencies inputs: script: chmod +x .ado/setup_droid_deps.sh && .ado/setup_droid_deps.sh + + - task: CmdLine@2 + displayName: Remove RNTesterApp.android.bundle + inputs: + script: rm -f ./packages/rn-tester/js/RNTesterApp.android.bundle + + - task: CmdLine@2 + displayName: Create RNTester bundle + inputs: + script: node cli.js bundle --entry-file ./packages/rn-tester/js/RNTesterApp.android.js --bundle-output ./packages/rn-tester/js/RNTesterApp.android.bundle --platform android + + - task: CmdLine@2 + displayName: gradlew installArchives + inputs: + script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs" + + # We have separate tasks to build rn-tester for debug and release due to a regression upstream. See https://github.com/facebook/react-native/issues/34168. + - task: CmdLine@2 + displayName: Build rn-tester debug + inputs: + script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew :packages:rn-tester:android:app:assembleDebug + + - task: CmdLine@2 + displayName: Build rn-tester release + inputs: + script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew :packages:rn-tester:android:app:assembleRelease + + - task: CopyFiles@2 + displayName: 'Copy rn-tester apks to build artifacts' + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)/packages/rn-tester/android/app/build/outputs/apk' + Contents: '**' + TargetFolder: '$(Build.StagingDirectory)/final/rn-tester' + + - task: CopyFiles@2 + displayName: 'Copy rn-tester android bundle to build artifacts' + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)/packages/rn-tester/js' + Contents: 'RNTesterApp.android.bundle' + TargetFolder: '$(Build.StagingDirectory)/final/rn-tester' \ No newline at end of file