name: Build Android on: pull_request: types: ["labeled"] jobs: build-android: if: contains(github.event.pull_request.labels.*.name, 'android-build') name: Build Android runs-on: ubuntu-latest environment: develop defaults: run: working-directory: android env: JAVA_OPTS: "-Xms512m -Xmx2g" GRADLE_OPTS: '-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError"' TERM: dumb steps: - name: Check out Git repository uses: actions/checkout@v3 - name: Decode Keystore run: echo ${{ secrets.KEYSTORE_BASE_64 }} | base64 -d > ./app/key.keystore - uses: c-hive/gha-yarn-cache@v2 - name: Install dependencies run: yarn install --prefer-offline - name: Set up JDK 11 uses: actions/setup-java@v3 with: distribution: "zulu" java-version: 11.0.14 cache: "gradle" - name: Make Gradlew Executable run: chmod +x ./gradlew - name: Set gradle.properties run: | echo -e "" > ./gradle.properties echo -e android.useAndroidX=true >> ./gradle.properties echo -e android.enableJetifier=true >> ./gradle.properties echo -e FLIPPER_VERSION=0.51.0 >> ./gradle.properties echo -e VERSIONCODE=${{ github.run_number }} >> ./gradle.properties echo -e APPLICATION_ID=chat.rocket.reactnative >> ./gradle.properties echo -e BugsnagAPIKey=${{ secrets.BUGSNAG_KEY }} >> ./gradle.properties echo -e KEYSTORE=${{ secrets.KEYSTORE }} >> ./gradle.properties echo -e KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} >> ./gradle.properties echo -e KEY_ALIAS=${{ secrets.KEY_ALIAS }} >> ./gradle.properties echo -e KEY_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} >> ./gradle.properties - name: Generate App APK run: | ./gradlew bundleExperimentalPlayRelease --no-daemon - name: Upload sourcemaps to Bugsnag run: | npx bugsnag-source-maps upload-react-native \ --api-key=${{ secrets.BUGSNAG_KEY }} \ --app-version-code=${{ github.event.number }} \ --platform android \ --source-map=app/build/generated/sourcemaps/react/experimentalPlay/release/app.bundle.map \ --bundle app/build/generated/assets/react/experimentalPlay/release/app.bundle - name: Store Artifacts uses: actions/upload-artifact@v3 with: name: app.bundle-${{ github.event.number }} path: app/build/generated/assets/react/experimentalPlay/release/app.bundle