From 7438f27428a87918596808835bd13c124e22030b Mon Sep 17 00:00:00 2001 From: Max Vorobev Date: Sat, 2 Mar 2019 20:32:00 +0300 Subject: [PATCH] Add CI pipeline for releasing --- .circleci/config.yml | 47 ++++++++++++++++++++++++++++++++++++++++++++ WORKSPACE | 6 +++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2abfedf0..783b22052 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,6 +63,28 @@ jobs: - run: sudo apt install -y expect - run: bazel run //:deploy-npm -- test $TEST_REPO_USERNAME $TEST_REPO_PASSWORD $TEST_REPO_EMAIL + release-approval: + machine: true + steps: + - checkout + - bazel_install + - run: bazel run @graknlabs_grabl//ci:release-approval + + deploy-npm: + machine: true + working_directory: ~/grakn + steps: + - checkout + - bazel_install + - bazel_add_rbe_credential + - run: bazel run //:deploy-npm -- npmjs $NPM_REPO_USERNAME $NPM_REPO_PASSWORD $NPM_REPO_EMAIL + + release-cleanup: + machine: true + steps: + - checkout + - run: git push --delete origin grakn-client-nodejs-release-branch + workflows: version: 2 grakn-client-nodejs-ci: @@ -72,3 +94,28 @@ workflows: filters: branches: only: master + requires: + - client-nodejs + - release-approval: + filters: + branches: + only: master + requires: + - client-nodejs + + # the 'grakn-client-nodejs-release' workflow is triggered by the creation of 'grakn-client-nodejs-release-branch' branch in graknlabs/client-nodejs + # it consists of jobs which: + # - publishes client-nodejs to npm + # - cleans up the 'grakn-client-nodejs-release-branch' branch which was created by the release-approval job + grakn-client-nodejs-release: + jobs: + - deploy-npm: + filters: + branches: + only: grakn-client-nodejs-release-branch + - release-cleanup: + requires: + - deploy-npm + filters: + branches: + only: grakn-client-nodejs-release-branch \ No newline at end of file diff --git a/WORKSPACE b/WORKSPACE index 4c6d522c5..20ffe5c42 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -44,7 +44,11 @@ git_repository( commit="6298bcf46c0ae8b1b5c9bd5138e10be38a3a9bc3" ) - +git_repository( + name = "graknlabs_grabl", + remote = "https://github.com/graknlabs/grabl", + commit="ad79f87f869d25694fe11196e16be42a80e95d14" +) # ----- @graknlabs_grakn deps ----- git_repository(