51 lines
		
	
	
		
			882 B
		
	
	
	
		
			YAML
		
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			882 B
		
	
	
	
		
			YAML
		
	
	
	
| stages:
 | |
|   - coverage
 | |
|   - 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
 | |
| 
 | |
| 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
 |