Skip to content

Commit

Permalink
fix(cicd): Publish step added
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj Adhikari committed May 18, 2021
1 parent adb6f5c commit 50e3f21
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 25 deletions.
72 changes: 51 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@ version: 2.1
orbs:
codecov: codecov/codecov@1.0.2

# Simple YAML anchors
aliases:
- &project_dir "~/project"
anchors:
- &main_only
filters:
branches:
only: main
- &release-tag-filter
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- &feature-branch-filter
filters:
branches:
only: /^(?!main$).*/

executors:
default-executor:
docker:
- image: cirrusci/flutter:stable

commands:
tests:
run-tests:
description: "Run local unit tests"
steps:
- run:
Expand Down Expand Up @@ -57,6 +69,13 @@ commands:
npm i -D @semantic-release/git
npm i -D semantic-release-dart
npx semantic-release --branches main
run-publish:
description: "Publishes to pub.dev"
steps:
- run:
name: Publishing to pub.dev
command: dart pub publish

dependencies:
description: "Download dependencies and setup global packages"
parameters:
Expand Down Expand Up @@ -86,7 +105,7 @@ jobs:
- run:
name: Make folder for test results
command: mkdir -p test-results/dart-tests
- tests
- run-tests
- run-test-coverage
- store_test_results:
path: test-results
Expand All @@ -96,33 +115,44 @@ jobs:
- dependencies:
shell: "/bin/bash -eo pipefail"
- run-semantic-versioning

publish:
executor: default-executor
steps:
- dependencies:
shell: "bin/bash -eo pipefail"
- run-publish

######################
# Workflow Definition
######################
workflows:
version: 2.1
test:
feature:
jobs:
- test:
filters:
branches:
ignore:
- main
test-changelog-tag:
<<: *feature-branch-filter
main:
jobs:
- test:
filters:
branches:
only:
- main
<<: *main_only
- semantic-versioning:
context:
- org-global
requires:
- test
filters:
branches:
only:
- main
- test
production:
when:
and:
- equal: [ https://github.com/Yonomi/yonomi-device-widgets.git, << pipeline.project.git_url >> ]
jobs:
- test:
<<: *release-tag-filter
- hold:
type: approval
requires:
- test
<<: *release-tag-filter
- publish:
requires:
- hold
<<: *release-tag-filter
2 changes: 1 addition & 1 deletion lib/components/modes_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:device_widgets/ui/color_constants.dart';
import 'package:device_widgets/ui/ring_border.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:yonomi_platform_sdk/graphql/devices/thermostat/thermostat_queries.graphql.dart';
import 'package:yonomi_platform_sdk/graphql/devices/thermostat/thermostat_queries.dart';

class ModesToolbar extends StatelessWidget {
final String deviceId;
Expand Down
4 changes: 1 addition & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ dependencies:
provider: ^4.3.3
flutter:
sdk: flutter
yonomi_platform_sdk:
git:
url: ssh://git@github.com/Yonomi/yonomi-sdk-dart.git
yonomi_platform_sdk: ^1.0.2

dev_dependencies:
mockito: ^4.1.4
Expand Down

0 comments on commit 50e3f21

Please sign in to comment.