From f5f0665ae29b1f19d74a62d2367c822fe818b844 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Fri, 15 Sep 2017 19:55:15 -0600 Subject: [PATCH] CircleCI 2.0 now supports tags --- .circleci/config.yml | 16 ++++++++-------- .circleci/scripts/index.js | 2 +- package.json | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2fdf325..54fbca0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,12 +42,12 @@ jobs: command: greenkeeper-lockfile-upload - deploy: name: Publish + filters: + tags: + only: /^v[0-9]\+\.[0-9]\+\.[0-9]\+$/ + branches: + ignore: /.*/ command: | - export TAG="v$(git log -1 --pretty=%B)" - if echo $TAG | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$"; then - npm publish - npm run build:scripts - node .circleci/lib/index.js - else - echo "No tag pushed, skipping deploy" - fi + npm publish + npm run build:scripts + npm run run:scripts diff --git a/.circleci/scripts/index.js b/.circleci/scripts/index.js index 8f3eef3..fb80d2e 100644 --- a/.circleci/scripts/index.js +++ b/.circleci/scripts/index.js @@ -7,8 +7,8 @@ process.on('unhandledRejection', err => { const { CIRCLE_PROJECT_USERNAME: OWNER, CIRCLE_PROJECT_REPONAME: REPO, + CIRCLE_TAG: TAG, GH_TOKEN: TOKEN, - TAG, } = process.env createRelease({ diff --git a/package.json b/package.json index f43e99a..e2474c3 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "test": "mocha --require babel-register", "build": "rm -rf lib && babel src --out-dir lib --source-maps --copy-files", "build:scripts": "rm -rf .circleci/lib && babel .circleci/scripts --out-dir .circleci/lib --source-maps", + "run:scripts": "node .circleci/lib/index.js", "watch": "npm run build -- --watch" }, "lint-staged": {