Skip to content

Instantly share code, notes, and snippets.

@ArnabXD
Created October 21, 2021 14:27
Show Gist options
  • Save ArnabXD/09ca4517883a0a1cbc7b7f90a0bbfef2 to your computer and use it in GitHub Desktop.
Save ArnabXD/09ca4517883a0a1cbc7b7f90a0bbfef2 to your computer and use it in GitHub Desktop.
Github Action - React Native - Android APK Build
name: Apk Build
on: workflow_dispatch
jobs:
build-android:
runs-on: ubuntu-latest
env:
commit-hash: ${{ github.sha }}
steps:
- uses: actions/checkout@v2
- uses: c-hive/gha-yarn-cache@v1
- name: Install node_modules
run: |
yarn install
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: Build Android Release
run: |
cd android && ./gradlew assembleRelease
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: 'app-${{ env.commit-hash }}.apk'
path: android/app/build/outputs/apk/release/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment