Skip to content

Commit

Permalink
build: fix CI npm deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
umutcanbolat committed Oct 3, 2019
1 parent f0ad6cb commit 92f0208
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
include:
- stage: npm release
script: echo "Deploying to npm ..."
script: npm run build
before_deploy: npm run build
deploy:
provider: npm
email: $NPM_EMAIL
Expand All @@ -25,7 +25,7 @@ jobs:
tags: true
- stage: github release
script: echo "Deploying to GitHub ..."
script: npm pack
before_deploy: npm pack
deploy:
provider: releases
api_key: $GITHUB_TOKEN
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ unrepeat(chorus.repeat(3));
//=> { repeated: 'Because I\'m happy. ', count: 3 }
```

## Versioning
## Releasing

See the [VERSIONING](VERSIONING.md) for details.
See the [RELEASING](RELEASING.md) for details.

## Credits

Expand Down
25 changes: 25 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Releasing

In order to release a new version, here is what we can do.

First get a recommended release type by running

```sh
npm run version:recommend
```

This will recommend one of the following release types depending on the commit history: `patch`, `minor` or `major` . We can use the recommended bump to release a new version.

```sh
npm run version:bump patch
```

This command;

- Runs tests and linters, builds project.
- Updates version number in package.json.
- Generates a [CHANGELOG](CHANGELOG.md) based on the latest commits. (See [Conventional Commits](https://github.com/conventional-changelog))
- Commits these changes with a message like `chore(RELEASE): publish %s` and creates a new tag with the version number.
- Pushes all these changes to upstream.

CI/CD will take care of the rest and publish the project to the npm registry and GitHub releases with the newly tagged version.
17 changes: 0 additions & 17 deletions VERSIONING.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "jest --coverage --bail",
"lint": "eslint --ext .js,.ts src/ --ext .js,.ts test/",
"version:recommend": "conventional-recommended-bump -p angular",
"version:bump": "npm version",
"version:bump": "npm version -m \"chore(RELEASE): publish %s\"",
"preversion": "npm test && npm run build",
"version": "npm run changelog && git add .",
"postversion": "git push && git push --tags",
Expand Down

0 comments on commit 92f0208

Please sign in to comment.