Optimize CI and update docs for context fetch #8
Workflow file for this run
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 & upload to Firebase App Distribution | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
build_apk: | |
name: Build Flutter (Android) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Write key.properties file | |
run: | | |
echo $KEY_PROPERTIES | base64 -d > android/key.properties | |
shell: bash | |
env: | |
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} | |
- name: Create keystore folder | |
run: mkdir -p android/keystore | |
- name: Write ethical_scanner_release.keystore file | |
env: | |
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }} | |
run: | | |
echo $RELEASE_KEYSTORE | base64 --decode > android/keystore/ethical_scanner_release.keystore | |
- name: Write ethical_scanner_debug.keystore file | |
run: | | |
echo $DEBUG_KEYSTORE | base64 -d > android/keystore/ethical_scanner_debug.keystore | |
shell: bash | |
env: | |
DEBUG_KEYSTORE: ${{ secrets.DEBUG_KEYSTORE }} | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '17' | |
distribution: 'temurin' # Eclipse Temurin https://adoptium.net/ | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
- run: flutter pub get | |
- run: flutter build apk --release | |
- name: Upload APK | |
uses: actions/upload-artifact@master | |
with: | |
name: apk-build | |
path: build/app/outputs/apk/release | |
beta_apk: | |
name: Upload Android Beta to Firebase App Distribution | |
needs: [ build_apk ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fix npm cache permissions | |
run: sudo chown -R 65534:0 "/root/.npm" | |
- name: Checkout Repository | |
uses: actions/checkout@v1 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '12' | |
- name: Install dependencies | |
run: npm install | |
- uses: actions/checkout@v1 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Download Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: apk-build | |
- name: Upload APK | |
uses: wzieba/[email protected] | |
with: | |
appId: ${{secrets.FIREBASE_ANDROID_APP_ID}} | |
token: ${{secrets.FIREBASE_TOKEN}} | |
groups: testers | |
releaseNotes: "Ethical Scanner Android Application Build" | |
file: app-release.apk |