Skip to content

Commit

Permalink
add support for building major releases
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcojocaru committed Nov 14, 2023
1 parent 2b000d3 commit 2a4ce15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,15 @@ the overall coverage at the top of the README is updated, along with the summary

## <a name="release"></a>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),
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:]]'"
},
Expand Down

0 comments on commit 2a4ce15

Please # to comment.