Build and deploy develop build for Android #213
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
| name: deploy-develop-android | |
| run-name: Build and deploy develop build for Android | |
| on: | |
| pull_request: | |
| branches: | |
| - 'ci/**' | |
| push: | |
| branches: | |
| - "develop" | |
| paths: | |
| - ".github/**" | |
| - "android/**" | |
| - "lib/**" | |
| - "pubspec.yaml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| ref: develop | |
| - uses: flutter-actions/setup-flutter@v3.6 | |
| with: | |
| version: '3.29.2' | |
| channel: 'stable' | |
| - name: install java (?) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'oracle' | |
| java-version: '17' | |
| - name: install ndk | |
| uses: nttld/setup-ndk@v1 | |
| id: setup-ndk | |
| with: | |
| ndk-version: r27 | |
| link-to-sdk: true | |
| - name: load certificate | |
| uses: mobiledevops/secret-to-file-action@v1 | |
| with: | |
| base64-encoded-secret: ${{ secrets.APP_CERTIFICATE }} | |
| filename: "keystore.jks" | |
| working-directory: ./android/app | |
| - name: create credentials | |
| env: | |
| keystore_pass: ${{ secrets.KEYSTORE_PASS }} | |
| run: | | |
| echo -e "storePassword: $keystore_pass\nkeyPassword: $keystore_pass\nkeyAlias: upload-unn-mobile\nstoreFile=keystore.jks\n" >> ./android/key.properties | |
| - name: install firebase | |
| run: curl -sL https://firebase.tools | bash | |
| - name: get dependencies | |
| run: flutter pub get | |
| - name: configure flutterfire | |
| env: | |
| firebase_token: ${{ secrets.FIREBASE_TOKEN }} | |
| run: | | |
| dart pub global activate flutterfire_cli 1.3.1 | |
| flutterfire configure -t $firebase_token -y -p unn-mobile-1 --platforms=android --android-package-name=ru.unn.unn_mobile | |
| - name: build | |
| run: flutter build apk | |
| - name: deploy | |
| env: | |
| firebase_token: ${{ secrets.FIREBASE_TOKEN }} | |
| app_id: ${{ secrets.FIREBASE_A_APP_ID }} | |
| run: | | |
| firebase --debug --project unn-mobile-1 --token $firebase_token appdistribution:distribute --groups "testers" --app "$app_id" --release-notes "$(git log -1 --pretty=%B)" "build/app/outputs/flutter-apk/app-release.apk" |