chore: implement ci and cd
ADD
.circleci/config.yml
+version: 2.1
+aliases:
+ - &docker_environment
+ - image: cirrusci/flutter:latest
+ - &restore_cache
+ keys:
+ # when lock file changes, use increasingly general patterns to restore cache
+ - pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}-{{ checksum "packages/graphql_flutter/pubspec.lock" }}
+ - pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}
+ - pub-packages-v1-
+jobs:
+ dependencies:
+ docker: *docker_environment
+ steps:
+ - checkout
+ - restore_cache: *restore_cache
+ - run:
+ name: Install dependencies (graphql)
+ command: |
+ cd packages/graphql
+ flutter packages get
+ - run:
+ name: Install dependencies (graphql_flutter)
+ command: |
+ cd packages/graphql_flutter
+ flutter packages get
+ - save_cache:
+ key: pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}-{{ checksum "packages/graphql_flutter/pubspec.lock" }}
+ paths:
+ - ~/.pub-cache
+ lint:
+ docker: *docker_environment
+ steps:
+ - checkout
+ - restore_cache: *restore_cache
+ - run:
+ name: Code linting (graphql)
+ command: |
+ cd packages/graphql
+ dartfmt **/*.dart -n --set-exit-if-changed
+ - run:
+ name: Code linting (graphql_flutter)
+ command: |
+ cd packages/graphql_flutter
+ dartfmt **/*.dart -n --set-exit-if-changed
+ coverage:
+ docker: *docker_environment
+ steps:
+ - checkout
+ - restore_cache: *restore_cache
+ - run:
+ name: Code coverage (graphql)
+ command: |
+ cd packages/graphql
+ flutter test --coverage
+ - run:
+ name: Code coverage (graphql_flutter)
+ command: |
+ cd packages/graphql_flutter
+ flutter test --coverage
+ - run:
+ name: Upload coverage
+ command: |
+ bash <(curl -s https://codecov.io/bash)
+ release:
+ docker:
+ - image: circleci/node:10
+ steps:
+ - checkout
+ - run:
+ name: Generate release tags
+ command: npx semantic-release@beta
+ publish:
+ docker: *docker_environment
+ steps:
+ - checkout
+ - restore_cache: *restore_cache
+ - run:
+ name: Install yq yaml tool
+ command: |
+ sudo add-apt-repository ppa:rmescandon/yq && \
+ sudo apt update && \
+ sudo apt install yq -y
+ - run:
+ name: Add git credentials
+ command: |
+ git config credential.helper 'cache --timeout=120'
+ git config user.email "github-bot@zino-app.com"
+ git config user.name "Zino App (Github bot)"
+ - run:
+ name: Add pub credentials
+ command: |
+ [[ ! -d ~/.pub-cache ]] && mkdir -p ~/.pub-cache
+
+ cat \<<EOF > ~/.pub-cache/credentials.json
+ {
+ "accessToken": ${PUB_ACCESS_TOKEN},
+ "refreshToken": ${PUB_REFRESH_TOKEN},
+ "tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
+ "scopes": ["https://www.googleapis.com/auth/userinfo.email", "openid"],
+ "expiration": ${PUB_EXPIRATION},
+ }
+ EOF
+ - run:
+ name: Patch pubspec with version (graphql)
+ command: |
+ cd packages/graphql
+
+ cat \<<EOF > patch.yaml
+ version: ${CIRCLE_TAG}
+ EOF
+
+ yq m pubspec.yaml patch.yaml
+ - run:
+ name: Patch pubspec with version (graphql_flutter)
+ command: |
+ cd packages/graphql_flutter
+
+ cat \<<EOF > patch.yaml
+ version: ${CIRCLE_TAG}
+ dependencies:
+ graphql: ^${CIRCLE_TAG}
+ EOF
+
+ yq m pubspec.yaml patch.yaml
+ - run:
+ name: Bump version numbers
+ command: |
+ git commit --allow-empty -m "build: Bump version numbers (via CircleCI) [skip ci]"
+ # Push quietly to prevent showing the token in log
+ git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git
+ - run:
+ name: Pub deployment (graphql)
+ command: |
+ cd packages/graphql
+ pub publish -f
+ - run:
+ name: Pub deployment (graphql_flutter)
+ command: |
+ cd packages/graphql
+ pub publish -f
+workflows:
+ default:
+ jobs:
+ - dependencies:
+ filters:
+ tags:
+ only: /^.*$/
+ - lint:
+ requires:
+ - dependencies
+ filters:
+ tags:
+ only: /^.*$/
+ - coverage:
+ requires:
+ - dependencies
+ filters:
+ tags:
+ only: /^.*$/
+ - release:
+ requires:
+ - dependencies
+ - lint
+ - coverage
+ filters:
+ branches:
+ only:
+ - master
+ - beta
+ - publish:
+ requires:
+ - dependencies
+ - lint
+ - coverage
+ filters:
+ tags:
+ only: /^.*$/
+ branches:
+ ignore: /.*/

DELETE
.cirrus.yml
-container:
- image: cirrusci/flutter:latest
-
-test_task:
- # pub_cache:
- # folder: $HOME/.pub-cache
- # fingerprint_script: cat pubspec.lock
- # populate_script: pub get
- pub_script: flutter packages get # later when we seperate graphql_client and graphql_flutter, we can change this
- format_script: dartfmt **/*.dart -n --set-exit-if-changed
- # analyze_script: dartanalyzer --fatal-infos .
- publishable_script: pub publish --dry-run
- environment:
- CODECOV_TOKEN: ENCRYPTED[fa57a1dda8bca6ad45ef10043f632b68b7824b60c634415f741a847788c1a44ae9374155e3af3346fb9b6d72bac0e1d3]
- test_script:
- # - pub global activate coverage
- # - dart --enable-vm-service=8111 --pause-isolates-on-exit test/* &
- # - pub global run coverage:collect_coverage --port=8111 --out=coverage.json --wait-paused --resume-isolates
- # - pub global run coverage:format_coverage --lcov --in=coverage.json --out=lcov.info --packages=.packages --report-on=lib
- - flutter test --coverage
- - bash <(curl -s https://codecov.io/bash)

ADD
.releaserc.yaml
+branches:
+ - master
+ - name: beta
+ prerelease: true
+ channel: beta
+plugins:
+ - '@semantic-release/commit-analyzer'
+ - '@semantic-release/release-notes-generator'
+ - '@semantic-release/github'

MODIFY
README.md
README.md
-Monorepo for [`graphql/client.dart`](./packages/graphql) and [`graphql_flutter`](./packages/graphql_flutter)
-
[![MIT License][license-badge]][license-link]
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg)](#contributors)
[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Watchers)](https://github.com/felangel/bloc)
[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Stars)](https://github.com/felangel/bloc)
-
-#### [![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC) Discord channel
-
-
+[![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC)
## GraphQL Flutter
[![Build Status][build-status-badge]][build-status-link]
[![Coverage][coverage-badge]][coverage-link]
-[![version][version-badge]][package-link]
+
+Monorepo for [`graphql/client.dart`](./packages/graphql) and [`graphql_flutter`](./packages/graphql_flutter)
## Roadmap
@@ -55,10 +51,10 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!
-[build-status-badge]: https://api.cirrus-ci.com/github/truongsinh/graphql-flutter.svg
-[build-status-link]: https://cirrus-ci.com/github/truongsinh/dart-uuid/master
-[coverage-badge]: https://codecov.io/gh/truongsinh/graphql-flutter/branch/master/graph/badge.svg
-[coverage-link]: https://codecov.io/gh/truongsinh/graphql-flutter
+[build-status-badge]: https://img.shields.io/circleci/project/github/zino-app/graphql-flutter/master.svg
+[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter
+[coverage-badge]: https://codecov.io/gh/zino-app/graphql-flutter/branch/master/graph/badge.svg
+[coverage-link]: https://codecov.io/gh/zino-app/graphql-flutter
[version-badge]: https://img.shields.io/pub/v/graphql_flutter.svg
[package-link]: https://pub.dartlang.org/packages/graphql_flutter/versions/1.0.0-alpha.3
[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg

MODIFY
packages/graphql/README.md
packages/graphql/README.md
[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Watchers)](https://github.com/felangel/bloc)
[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Stars)](https://github.com/felangel/bloc)
-
-#### [![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC) Discord channel
-
+[![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC)
## Usage
```dart
import 'package:graphql/client.dart';
```
-Usage for the standalone client is still poorly documented
+Usage for the standalone client is still poorly documented
## Contributing

MODIFY
packages/graphql/pubspec.yaml
packages/graphql/pubspec.yaml
@@ -24,4 +24,4 @@ dev_dependencies:
test: ^1.5.3
environment:
- sdk: ">=2.2.0 <3.0.0"
+ sdk: ">=2.1.0 <3.0.0"

MODIFY
packages/graphql_flutter/pubspec.yaml
packages/graphql_flutter/pubspec.yaml
@@ -9,7 +9,7 @@ authors:
homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql_flutter
dependencies:
- graphql: ^1.0.1-beta # path: ../graphql
+ graphql: ^1.0.1-beta
flutter:
sdk: flutter
meta: ^1.1.6
@@ -25,4 +25,4 @@ dev_dependencies:
test: ^1.5.3
environment:
- sdk: ">=2.2.0 <3.0.0"
+ sdk: ">=2.1.0 <3.0.0"

chore: implement ci and cd