From 5efab2bbe595ac7199e466c2faa01a3607022980 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Thu, 19 Oct 2017 22:12:59 +0200 Subject: [PATCH] build: allow publish from continous integration tool --- circle.yml | 10 ++++++++++ scripts/publish.sh | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 scripts/publish.sh diff --git a/circle.yml b/circle.yml index 7437d585c..22845d561 100644 --- a/circle.yml +++ b/circle.yml @@ -29,3 +29,13 @@ test: - nvm alias default 8 - yarn run test:ci - yarn run coverage:publish +deployment: + production: + tag: /(v)?[0-9]+(\.[0-9]+)*/ + commands: + - ./scripts/publish.sh +general: + branches: + ignore: + - gh-pages # list of branches to ignore + - /release\/.*/ # or ignore regexes diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100755 index 000000000..3ffc3af9c --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Get the last tag from GitHub +lastTag=$(git describe --tags $(git rev-list --tags --max-count=1)) + +# Print it to the console for verification +echo "Bumping version to new tag: ${lastTag}" + +# Bump the version +npm --no-git-tag-version version $lastTag + +# Publish to NPM +npm publish