From 2a4ce1530acf712a0f6e93c9573c4aaacf15e58d Mon Sep 17 00:00:00 2001 From: alexcojocaru Date: Mon, 13 Nov 2023 16:18:20 -0800 Subject: [PATCH] add support for building major releases --- README.md | 14 +++++--------- package.json | 4 +++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 02b44f1..585c383 100644 --- a/README.md +++ b/README.md @@ -147,19 +147,15 @@ the overall coverage at the top of the README is updated, along with the summary ## Release -#### Build a minor release -``` -$ npm run release -``` +#### Build a release +Use one of the following, depending on what kind of release you need to build: +- major release: `npm run release-major` +- minor release: `npm run release-minor` +- patch release: `npm run release-patch` *NB: If the release script fails to run, check that there are no files modified locally, in which case commit them or clean them up before running the release.* -#### Build a patch release -``` -$ npm run release-patch -``` - ## Publish To publish a release, first [build it](#release) - that creates the dist file(s), diff --git a/package.json b/package.json index 9799712..d72c94a 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,11 @@ "minify": "uglifyjs src/index.js --compress --mangle --warn --output dist/index.min.js", "build": "npm run clean && npm run test-coverage && mkdir dist && cp src/index.js dist/index.js", "release-patch": "npm run clean && npm run test-coverage && mkdir dist && cp src/index.js dist/index.js && npm run version:bump-patch --silent", - "release": "npm run clean && npm run test-coverage && mkdir dist && cp src/index.js dist/index.js && npm run version:bump-minor --silent", + "release-minor": "npm run clean && npm run test-coverage && mkdir dist && cp src/index.js dist/index.js && npm run version:bump-minor --silent", + "release-major": "npm run clean && npm run test-coverage && mkdir dist && cp src/index.js dist/index.js && npm run version:bump-major --silent", "version:bump-patch": "npm version patch --silent", "version:bump-minor": "npm version minor --silent", + "version:bump-major": "npm version major --silent", "version:add": "echo \"/* Version: $(npm run version:extract --silent) , Build time: $(date -u '+%Y-%m-%d %H:%M:%S') UTC */\n$(cat dist/index.js)\" > dist/index.js", "version:extract": "cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'" },