mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
Merge pull request #81 from oceanprotocol/feature/bumpversion
Feature/bumpversion
This commit is contained in:
commit
9a590b9788
7
.bumpversion.cfg
Normal file
7
.bumpversion.cfg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[bumpversion]
|
||||||
|
current_version = 0.1.2
|
||||||
|
|
||||||
|
[bumpversion:file:package.json]
|
||||||
|
search = "version": "{current_version}",
|
||||||
|
replace = "version": "{new_version}",
|
||||||
|
|
15
README.md
15
README.md
@ -24,6 +24,8 @@ If you're a developer and want to contribute to, or want to utilize this marketp
|
|||||||
- [🐳 Use with Barge](#-use-with-barge)
|
- [🐳 Use with Barge](#-use-with-barge)
|
||||||
- [🛳 Production](#-production)
|
- [🛳 Production](#-production)
|
||||||
- [👩🔬 Testing](#-testing)
|
- [👩🔬 Testing](#-testing)
|
||||||
|
- [🎁 Contributing](#-contributing)
|
||||||
|
- [⬆️ Bumping version](#-bumping-version)
|
||||||
- [✨ Code Style](#-code-style)
|
- [✨ Code Style](#-code-style)
|
||||||
- [🏛 License](#-license)
|
- [🏛 License](#-license)
|
||||||
|
|
||||||
@ -76,6 +78,19 @@ npm test
|
|||||||
|
|
||||||
Launches the test runner in the interactive watch mode.
|
Launches the test runner in the interactive watch mode.
|
||||||
|
|
||||||
|
## 🎁 Contributing
|
||||||
|
|
||||||
|
See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation.
|
||||||
|
|
||||||
|
## ⬆️ Bumping version
|
||||||
|
|
||||||
|
Use the `bumpversion.sh` script to bump the project version. You can execute the script using {major|minor|patch} as first argument to bump the version accordingly:
|
||||||
|
- To bump the patch version: `./bumpversion.sh patch`
|
||||||
|
- To bump the minor version: `./bumpversion.sh minor`
|
||||||
|
- To bump the major version: `./bumpversion.sh major`
|
||||||
|
|
||||||
|
After that, you need to commit, push and git tag the commit if desired/needed.
|
||||||
|
|
||||||
## ✨ Code Style
|
## ✨ Code Style
|
||||||
|
|
||||||
For linting and auto-formatting you can use from the root of the project:
|
For linting and auto-formatting you can use from the root of the project:
|
||||||
|
36
bumpversion.sh
Executable file
36
bumpversion.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
usage(){
|
||||||
|
echo "Usage: $0 {major|minor|patch} [--tag]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! [ -x "$(command -v bumpversion)" ]; then
|
||||||
|
echo 'Error: bumpversion is not installed.' >&2
|
||||||
|
exit 1
|
||||||
|
elif ! git diff-index --quiet HEAD -- >/dev/null 2>&1; then
|
||||||
|
echo 'There are local changes in your the git repository. Please commit or stash them before bumping version.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
echo "Illegal number of parameters"
|
||||||
|
usage
|
||||||
|
elif [[ $1 != 'major' && $1 != 'minor' && $1 != 'patch' ]]; then
|
||||||
|
echo 'First argument must be {major|minor|patch}'
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $2 == '--tag' ]]; then
|
||||||
|
if git branch --contains $(git rev-parse --verify HEAD) | grep -E 'master'; then
|
||||||
|
bumpversion --tag --commit $1
|
||||||
|
else
|
||||||
|
echo "Only master tags can be tagged"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
bumpversion $1
|
||||||
|
fi
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "commons",
|
"name": "commons",
|
||||||
"description": "Ocean Protocol marketplace to explore, download, and publish open data sets.",
|
"description": "Ocean Protocol marketplace to explore, download, and publish open data sets.",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user