Skip to content

Instantly share code, notes, and snippets.

@kuyazee
Created September 6, 2021 10:52
Show Gist options
  • Save kuyazee/44263dfeae7528972657a07d8d254304 to your computer and use it in GitHub Desktop.
Save kuyazee/44263dfeae7528972657a07d8d254304 to your computer and use it in GitHub Desktop.
Flutter, Firebase, and Gitlab CI Yaml Settings
stages:
- generate
- test
- build ios
- build android
- deploy
- clean
flutter_generate:
stage: generate
script:
- flutter pub get
- flutter pub run build_runner build --delete-conflicting-outputs
artifacts:
paths:
- lib/
- plugins/
expire_in: 1 day
only:
- develop
- release/test
tags:
- mbpz
flutter_test:
stage: test
script:
- flutter analyze
- flutter test --coverage
artifacts:
paths:
- coverage
tags:
- mbpz
only:
- develop
- release/test
flutter_build_ios:
stage: build ios
artifacts:
paths:
- ios/build/Runner.ipa
expire_in: 1 day
before_script:
- flutter clean
- flutter packages get
script:
- flutter build ios
- cd ios
- pod install --repo-update
- xcodebuild -quiet clean archive -workspace Runner.xcworkspace -scheme Runner -destination 'generic/platform=iOS' -archivePath "../artifacts/RunnerArchive"
- xcodebuild -quiet -exportArchive -archivePath "../artifacts/RunnerArchive.xcarchive" -exportPath ../artifacts/ -exportOptionsPlist ExportOptions.plist
tags:
- mbpz
only:
- release/test
flutter_build_android:
stage: build android
artifacts:
paths:
- build/app/outputs/apk/release/app-release.apk
expire_in: 1 day
before_script:
- flutter clean
- flutter packages get
script:
- flutter build apk
tags:
- mbpz
only:
- release/test
flutter_deploy_ios:
stage: deploy
before_script:
- sh scripts/generate_changelog.sh $CHANGELOG_ENV $CI_COMMIT_BRANCH $CI_COMMIT_MESSAGE $CI_COMMIT_SHA
- cd ios
- bundle config set deployment 'true'
- bundle install
script:
- echo 'Flutter Deploy iOS'
- bundle exec fastlane deploy flavor:$IOS_SCHEME env:$FLUTTER_MAIN method:$IOS_BUILD_METHOD
tags:
- mbpz
only:
- release/test
flutter_deploy_android:
stage: deploy
before_script:
- sh scripts/generate_changelog.sh $CHANGELOG_ENV $CI_COMMIT_BRANCH $CI_COMMIT_MESSAGE $CI_COMMIT_SHA
- cd android
- bundle config set deployment 'true'
- bundle install
script:
- echo 'Flutter Deploy Android on $CHANGELOG_ENV'
- bundle exec fastlane deploy flavor:$ANDROID_FLAVOR env:$FLUTTER_MAIN target:$ANDROID_DEST
tags:
- mbpz
only:
- release/test
flutter_clean:
stage: clean
script:
- flutter clean
only:
- develop
- release/test
tags:
- mbpz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment