Merge pull request #330 from Real-Dev-Squad/fix/activeTasks #95
This file contains 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
name: Build Android | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build-testing: | |
if: github.ref == 'refs/heads/develop' | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js v16 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Install dependencies | |
run: | | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
- 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 assets folder | |
run: | | |
cd android/app/src/main && | |
if [ -d "assets" ]; then | |
rm -r assets | |
fi | |
- name: Build release | |
run: | | |
mkdir -p android/app/src/main/assets && | |
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && | |
cd android && | |
./gradlew assembleDebug | |
- name: list files | |
run: ls -lrt android/app/build/outputs/apk/debug | |
- name: upload artifact to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
with: | |
appId: ${{secrets.FIREBASE_APP_ID}} | |
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
groups: ${{secrets.GROUPS}} | |
file: android/app/build/outputs/apk/debug/app-debug.apk |