Created
June 27, 2025 04:25
-
-
Save bamnet/c5d7681102b0adebbe6933cce7464328 to your computer and use it in GitHub Desktop.
Flutter CI/CD
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
image: ghcr.io/cirruslabs/flutter:latest | |
stages: | |
- test | |
- deploy | |
unit_tests: | |
stage: test | |
cache: | |
- key: | |
files: | |
- pubspec.yaml | |
paths: | |
- ~/.pub-cache | |
script: | |
- flutter test packages/* | |
- flutter test --coverage | |
- lcov --remove coverage/lcov.info 'lib/generated/*' --output-file coverage.info | |
- lcov --list coverage.info | |
deploy_android: | |
stage: deploy | |
when: manual | |
cache: | |
- key: | |
files: | |
- android/Gemfile.lock | |
paths: | |
- vendor/ruby | |
script: | |
# Download the GitLab secure files at [SECURE_FILES_DOWNLOAD_PATH] | |
- curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash | |
# Move the key file into the android directory. | |
- cp .secure_files/key.properties android/ | |
- cp .secure_files/keystore.jks android/ | |
# Fastlane! | |
- cd android/fastlane | |
- gem install bundler | |
- bundle config set --local path 'vendor/ruby' | |
- bundle install | |
- bundle exec fastlane internal | |
## Gitlab does not support macOS runners for free accounts. | |
# deploy_ios: | |
# image: macos-14-xcode-15 | |
# tags: | |
# - saas-macos-medium-m1 | |
# stage: deploy | |
# when: manual | |
# cache: | |
# - key: | |
# files: | |
# - android/Gemfile.lock | |
# paths: | |
# - vendor/ruby | |
# script: | |
# - cd ios/fastlane | |
# - gem install bundler | |
# - bundle config set --local path 'vendor/ruby' | |
# - bundle install | |
# - bundle exec fastlane beta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment