stages: - coverage - builddocs - deploy - publish test: tags: - linux stage: coverage image: dart script: - dart pub get - dart pub run test code_analyze: tags: - docker stage: coverage image: cirrusci/flutter dependencies: [] script: - flutter format lib/ test/ --set-exit-if-changed - flutter analyze build_api_doc: tags: - docker stage: builddocs image: cirrusci/flutter script: - dartdoc --exclude "dart:async,dart:collection,dart:convert,dart:core,dart:developer,dart:io,dart:isolate,dart:math,dart:typed_data,dart:ui" artifacts: paths: - doc/api/ only: - main pages: tags: - linux stage: deploy image: alpine:latest script: - mv doc/api/ public dependencies: - build_api_doc artifacts: paths: - public only: - main dry-run: stage: publish image: dart script: - rm -rf ./docs - dart pub get - dart pub publish --dry-run pub-dev: stage: publish image: dart dependencies: [dry-run] script: - rm -rf ./docs - | if [ -z "${PUB_DEV_CREDENTIALS}" ]; then echo "Missing PUB_DEV_CREDENTIALS environment variable" exit 1 fi mkdir -p ~/.config/dart/ cp "${PUB_DEV_CREDENTIALS}" ~/.config/dart/pub-credentials.json - dart pub get - dart pub publish --force rules: - if: $CI_COMMIT_TAG