Last active
August 8, 2024 09:30
-
-
Save empeje/9ebad8499a9f251cac14124db90e2f33 to your computer and use it in GitHub Desktop.
Firebase App Distribution Android - GitLab CI
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
| .android_build: | |
| image: openjdk:8-jdk | |
| stage: build # kind of job | |
| variables: | |
| ANDROID_COMPILE_SDK: "29" | |
| ANDROID_BUILD_TOOLS: "29.0.3" | |
| ANDROID_SDK_TOOLS: "4333796" | |
| FLUTTER_VERSION: "https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_1.22.6-stable.tar.xz" | |
| before_script: | |
| # Install Firebase | |
| - curl -L https://firebase.tools/bin/linux/latest -o firebase | |
| - chmod +x firebase | |
| - mv firebase /usr/local/bin/ | |
| # Install Android | |
| - apt-get --quiet update --yes | |
| - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 | |
| - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip | |
| - unzip -d android-sdk-linux android-sdk.zip | |
| - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null | |
| - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null | |
| - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null | |
| - export ANDROID_HOME=$PWD/android-sdk-linux | |
| - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ | |
| ## temporarily disable checking for EPIPE error and use yes to accept all licenses | |
| - set +o pipefail | |
| - yes | android-sdk-linux/tools/bin/sdkmanager --licenses | |
| - set -o pipefail | |
| # Install Flutter | |
| - wget --output-document=flutter-sdk.tar.xz $FLUTTER_VERSION | |
| - tar -xf flutter-sdk.tar.xz | |
| - export PATH=$PATH:$PWD/flutter/bin | |
| - flutter precache | |
| - flutter packages get | |
| - flutter clean | |
| stages: | |
| - test # All jobs related for testing such as Unit Test | |
| - build # All jobs related for building app for iOS and Android | |
| #### | |
| #### flutter debug | |
| #### | |
| flutter_build_debug: #Job name | |
| extends: .android_build | |
| retry: 2 | |
| script: | |
| - flutter build apk --flavor dev | |
| artifacts: | |
| paths: | |
| - build/app/outputs/flutter-apk/app-dev-release.apk | |
| #### | |
| #### flutter release | |
| #### | |
| flutter_build_release: #Job name | |
| extends: .android_build | |
| retry: 2 | |
| script: | |
| - flutter build apk --release --flavor prod | |
| - flutter build appbundle --release --flavor prod | |
| - ./bin/app_distribution.sh | |
| artifacts: | |
| paths: | |
| - build/app/outputs/flutter-apk/app-prod-release.apk | |
| - build/app/outputs/bundle/prodRelease/app-prod-release.aab |
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
| #!/usr/bin/env bash | |
| RELEASE_NOTE=$(git log -1 --oneline --format=%s) | |
| firebase appdistribution:distribute build/app/outputs/flutter-apk/app-prod-release.apk \ | |
| --token "$FIREBASE_TOKEN" \ | |
| --app "$APP_ID" \ | |
| --release-notes "$RELEASE_NOTE" --testers-file testers.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok Thanks @empeje
I created new one with this: