Skip to content

Commit

Permalink
Merge pull request #1250 from rasaha91/add-rntester-to-artifacts
Browse files Browse the repository at this point in the history
Publish rn-tester apks and bundle to build artifacts
  • Loading branch information
rasaha91 authored Jul 11, 2022
2 parents 7807d66 + 214e540 commit 7afb6fa
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 37 deletions.
26 changes: 0 additions & 26 deletions .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 4 additions & 11 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions .ado/templates/android-build-office.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 7afb6fa

Please sign in to comment.