From 155fbcf481fd26d2c9c115adb79a5592d0192b8e Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Mon, 10 Jul 2017 14:28:17 -0700 Subject: [PATCH] Automate package.json versioning as part of build (#10) The package.json's version field is now 0.0.0. Installing branch-manager from the build folder will now always tell you that you're running 0.0.0. The version has to be parseable by node-semver so it can't be something be readable like "develop". On builds triggered by a tags that match [0-9]+\.[0-9]+\.[0-9]+, the version is automatically updated in the build/package.json to reflect the tag. --- circle.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 20bbd82..1429686 100644 --- a/circle.yml +++ b/circle.yml @@ -29,6 +29,7 @@ jobs: set -euo pipefail TAG=${CIRCLE_TAG:-} if [[ ${TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + yarn version --new-version "$TAG" --no-git-tag-version echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc npm publish else diff --git a/package.json b/package.json index f790cd5..dcb7c79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "branch-manager", - "version": "0.2.0", + "version": "0.0.0", "description": "Manage your branches on Github", "main": "./dist/main.js", "repository": "https://github.com/michael-yx-wu/branch-manager",