From e0a62b1a42d6be63b1267551bccfdfd8a21a998b Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Mon, 8 Apr 2019 17:33:38 +0200 Subject: [PATCH 1/3] Added bumpversion --- .bumpversion.cfg | 7 +++++++ bumpversion.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .bumpversion.cfg create mode 100755 bumpversion.sh diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..2b86ecd --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,7 @@ +[bumpversion] +current_version = 0.1.1 + +[bumpversion:file:package.json] +search = "version": "{current_version}", +replace = "version": "{new_version}", + diff --git a/bumpversion.sh b/bumpversion.sh new file mode 100755 index 0000000..4c9ad5a --- /dev/null +++ b/bumpversion.sh @@ -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 From ca558cb58c6a076038e1ae134896e35413fef11b Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Mon, 8 Apr 2019 17:34:12 +0200 Subject: [PATCH 2/3] Bumped version to 0.1.2 --- .bumpversion.cfg | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2b86ecd..23228a7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.1 +current_version = 0.1.2 [bumpversion:file:package.json] search = "version": "{current_version}", diff --git a/package.json b/package.json index 7b19994..16e20dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "commons", "description": "Ocean Protocol marketplace to explore, download, and publish open data sets.", - "version": "0.1.0", + "version": "0.1.2", "private": true, "license": "Apache-2.0", "scripts": { From 8e6a870cb57af13ce4248633fb75c8723d1cbcb8 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 9 Apr 2019 10:42:00 +0200 Subject: [PATCH 3/3] Added bumpversion notes to readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index fdaf931..cd6f8dc 100644 --- a/README.md +++ b/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) - [🛳 Production](#-production) - [👩‍🔬 Testing](#-testing) +- [🎁 Contributing](#-contributing) +- [⬆️ Bumping version](#-bumping-version) - [✨ Code Style](#-code-style) - [🏛 License](#-license) @@ -76,6 +78,19 @@ npm test 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 For linting and auto-formatting you can use from the root of the project: