-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[added] instruction and introduction into readme
- Loading branch information
Showing
1 changed file
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,53 @@ | ||
# release-script | ||
release tools for npm and bower packages | ||
|
||
Release tool for npm and bower packages. | ||
|
||
Initial idea is from `React-Bootstrap` release tools `./tools/release`, | ||
that have been written by [Matt Smith @mtscout6](https://github.com/mtscout6) | ||
|
||
#### This script does these steps: | ||
|
||
- ensures that git repo has no pending changes | ||
- ensures that git repo last version is fetched | ||
- checks linting and tests by running `npm run test` command | ||
- does version bump, with `preid` if it is requested | ||
- builds all by `npm run build` command | ||
- generates changelog using `mt-changelog` | ||
- adds and commits changed `CHANGELOG.md` and `package.json` files to git repo | ||
- adds git tag with changelog message and new version | ||
- pushes changes to github repo | ||
- releases npm package by `npm publish` command | ||
- if `bowerRepo` field is present in the `package.json`, then it releases bower package: | ||
- clones bower repo to local `tmpBowerRepo` temp folder. `git clone bowerRepo tmpBowerRepo` | ||
- By default it is named `tmp-bower-repo` | ||
- It is possible to set a custom `tmpBowerRepo` field in the `package.json` | ||
- then it cleans up all but `.git` files in the `tmpBowerRepo` | ||
- then copies all files from `bowerRoot` to `tmpBowerRepo` | ||
- (that has to be generated with `npm run build`) | ||
- `bowerRoot` also can be set to a custom value in the `package.json` | ||
- then by `git add -A .` adds all bower distr files to the temporary git repo | ||
- commits, tags and pushes the same as for the `npm` package. | ||
- then deletes the `tmpBowerRepo` folder | ||
|
||
## Installation | ||
|
||
```sh | ||
> npm install -D release-script | ||
``` | ||
|
||
Set `bowerRepo` in your `package.json` if you need `bower` releases too. | ||
```js | ||
"bowerRepo": "[email protected]:<org-author-name>/<name-of-project>-bower.git", | ||
``` | ||
|
||
Then you can release like that: | ||
```sh | ||
> release patch | ||
> release minor --preid alpha | ||
``` | ||
|
||
You can use `--dry-run` option to check first what will be done and if it is OK. | ||
```sh | ||
> release major --dry-run --verbose | ||
``` | ||
This option prevents from running `danger` steps. (`git push`, `npm publish` etc) |