1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

simplify release tasks, automatic changelog

This commit is contained in:
Matthias Kretschmann 2019-05-28 01:54:27 +02:00
parent 8dadf21726
commit 41d6726bed
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 25 additions and 26 deletions

View File

@ -29,7 +29,7 @@ If you're a developer and want to contribute to, or want to utilize this marketp
- [✨ Code Style](#-code-style)
- [🛳 Production](#-production)
- [⬆️ Releases](#-releases)
- [Changelog](#changelog)
- [📜 Changelog](#-changelog)
- [🎁 Contributing](#-contributing)
- [🏛 License](#-license)
@ -125,6 +125,7 @@ Builds the client for production to the `./client/build` folder, and the server
From a clean `master` branch you can run any release task doing the following:
- bumps the project version
- auto-generates and updates the CHANGELOG.md file from commit messages
- creates a Git tag
- commits and pushes everything
- creates a GitHub release with commit messages as description
@ -132,30 +133,16 @@ From a clean `master` branch you can run any release task doing the following:
You can execute the script using {major|minor|patch} as first argument to bump the version accordingly:
- To bump a patch version: `npm run release`
- To bump a minor version: `npm run release-minor`
- To bump a major version: `npm run release-major`
- To bump a minor version: `npm run release minor`
- To bump a major version: `npm run release major`
By creating the Git tag with these tasks, Travis will trigger a new Kubernetes deployment automatically aftr a successful tag build.
By creating the Git tag with these tasks, Travis will trigger a new Kubernetes live deployment automatically, after a successful tag build.
For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases)
## Changelog
## 📜 Changelog
See the [CHANGELOG.md](./CHANGELOG.md) file.
This file is auto-generated from commit & PR messages upon running:
```bash
npm run changelog
```
This will update the CHANGELOG.md file with commit messages in a nice format. Doing a release will not automatically update that changelog file. So after every release this needs to done with the above command and simply committed back into `master`.
For convenience, you can use this command which updates the CHANGELOG.md file, commits the result, and pushes changes to `master`:
```bash
npm run changelog:commit
```
See the [CHANGELOG.md](./CHANGELOG.md) file. This file is auto-generated during the above mentioned release process.
## 🎁 Contributing

View File

@ -16,12 +16,8 @@
"lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
"lint:fix": "eslint --fix --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
"lint": "npm run lint:js && npm run lint:css",
"release": "./node_modules/release-it/bin/release-it.js --git.tagName='v${version}' --github.release --non-interactive --no-npm.publish",
"release-minor": "./node_modules/release-it/bin/release-it.js minor --git.tagName='v${version}' --github.release --non-interactive --no-npm.publish",
"release-major": "./node_modules/release-it/bin/release-it.js major --git.tagName='v${version}' --github.release --non-interactive --no-npm.publish",
"changelog": "auto-changelog",
"changelog:commit": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog' && git push",
"beforeStage": "npm run changelog"
"release": "release-it --non-interactive",
"changelog": "auto-changelog -p"
},
"dependencies": {},
"devDependencies": {
@ -45,5 +41,21 @@
"repository": {
"type": "git",
"url": "https://github.com/oceanprotocol/commons"
},
"release-it": {
"scripts": {
"beforeStart": "npm test",
"beforeStage": "npm run changelog",
"afterRelease": "echo Successfully released ${name} v${version} to ${repo.repository}."
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": false
}
}
}