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": {