Created
September 22, 2020 05:36
-
-
Save jenish-jadav/c8be9177fce357a97732f3f3d0b214e0 to your computer and use it in GitHub Desktop.
React Native Bitbucket Pipeline for Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: node:10.15.3 | |
| pipelines: | |
| default: | |
| - step: | |
| image: node:10.15.3 | |
| caches: | |
| - node | |
| - gradle | |
| script: | |
| - npm install | |
| - npx react-native link | |
| - step: | |
| image: mingc/android-build-box:latest | |
| caches: | |
| - node | |
| - gradle | |
| - android-sdk | |
| script: | |
| - npm install | |
| # Download and unzip android sdk | |
| - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip | |
| - unzip -o -qq android-sdk.zip -d android-sdk | |
| # Define Android Home and add PATHs | |
| - export ANDROID_HOME="/opt/atlassian/pipelines/agent/build/android-sdk" | |
| - export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH" | |
| # Download packages. | |
| - yes | sdkmanager "platform-tools" | |
| - yes | sdkmanager "platforms;android-27" | |
| - yes | sdkmanager "build-tools;27.0.3" | |
| - yes | sdkmanager "extras;android;m2repository" | |
| - yes | sdkmanager "extras;google;m2repository" | |
| - yes | sdkmanager "extras;google;instantapps" | |
| - yes | sdkmanager --licenses | |
| # Build apk | |
| - chmod a+x ./android/gradlew | |
| - cd android | |
| - ./gradlew assembleRelease | |
| artifacts: | |
| - app/build/outputs/*.apk | |
| definitions: | |
| caches: | |
| android-sdk: android-sdk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment