From 7c202c199001a9c3170b9dfc9d5bc7161426045c Mon Sep 17 00:00:00 2001 From: Mounir Boudraa Date: Thu, 16 Aug 2018 15:22:44 -0400 Subject: [PATCH] enable ci with circleci (#1) * enable ci * publish on bintray --- .circleci/config.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 21 +++++++++++++++++++ build.gradle | 12 +++++++---- flow/build.gradle | 11 +++++++++- 4 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..33e8053 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,48 @@ +version: 2 +jobs: + build: + working_directory: ~/Flow + docker: + - image: circleci/android:api-27-alpha + environment: + JVM_OPTS: -Xmx3200m + steps: + - checkout + - run: + name: Run Tests + command: ./gradlew test build + - store_artifacts: + path: flow/build/reports + destination: reports + - store_test_results: + path: flow/build/test-results + publish: + docker: + - image: circleci/android:api-27-alpha + environment: + JVM_OPTS: -Xmx3200m + steps: + - run: + name: Publish on Bintray + command: ./gradlew bintrayUpload -PbintrayUser=$BINTRAY_USER -PbintrayKey=$BINTRAY_API_KEY -PdryRun=false + +workflows: + version: 2 + build: + jobs: + - build + + publish: + jobs: + - build: + filters: # required since `publish` has tag filters AND requires `build` + tags: + only: /.*/ + - publish: + requires: + - build + filters: + tags: + only: /^v([0-9]*)./ + branches: + only: master diff --git a/README.md b/README.md index efac1ac..08481a0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,27 @@ +[![CircleCI](https://circleci.com/gh/mboudraa/flow/tree/master.svg?style=svg)](https://circleci.com/gh/mboudraa/flow/tree/master) +[ ![Download](https://api.bintray.com/packages/mboudraa/maven/flow/images/download.svg) ](https://bintray.com/mboudraa/maven/flow/_latestVersion) + # Flow If Redux/MVI and State machines architectures had a child, it would be **Flow** + +## Download + +Download the latest JAR or grab via Maven: + +```xml + + com.mboudraa.flow + flow + 0.1 + +``` + +or Gradle: + +```gradle +implementation 'com.mboudraa.flow:flow:0.1' +``` ## A Few Words About Redux/MVI diff --git a/build.gradle b/build.gradle index a34149c..6f54ea7 100644 --- a/build.gradle +++ b/build.gradle @@ -9,9 +9,8 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.2.0-beta05' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.novoda:bintray-release:0.8.1' - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files } } @@ -26,5 +25,10 @@ task clean(type: Delete) { delete rootProject.buildDir } -group 'com.mboudraa.flow' -version '1.0-SNAPSHOT' \ No newline at end of file +ext.releaseInfo = [ + "userOrg" : 'mboudraa', + "groupId" : 'com.mboudraa.flow', + "version" : '0.1', + "website" : 'https://github.com/mboudraa/flow', + "licences": ['Apache-2.0'] +] \ No newline at end of file diff --git a/flow/build.gradle b/flow/build.gradle index 6a3cd3d..d663dc1 100644 --- a/flow/build.gradle +++ b/flow/build.gradle @@ -1,10 +1,19 @@ apply plugin: 'kotlin' - +apply plugin: 'com.novoda.bintray-release' dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation "junit:junit:4.12" testImplementation "com.google.truth:truth:0.42" +} +publish { + userOrg = releaseInfo.userOrg + groupId = releaseInfo.groupId + publishVersion = releaseInfo.version + licences = releaseInfo.licences + website = releaseInfo.website + artifactId = 'flow' + desc = 'A State Machine DSL for Kotlin' } \ No newline at end of file