From 499e31991bbd58fe291dd1c401af0c9a8c29a7d3 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 9 Apr 2019 14:32:33 +0200 Subject: [PATCH] remove bumpversion, add documentation --- .bumpversion.cfg | 7 ------- .travis.yml | 8 -------- README.md | 25 ++++++++++++++++++------- bumpversion.sh | 36 ------------------------------------ package.json | 9 +++++---- 5 files changed, 23 insertions(+), 62 deletions(-) delete mode 100644 .bumpversion.cfg delete mode 100755 bumpversion.sh diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 23228a7..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[bumpversion] -current_version = 0.1.2 - -[bumpversion:file:package.json] -search = "version": "{current_version}", -replace = "version": "{new_version}", - diff --git a/.travis.yml b/.travis.yml index b2281d2..c3ef17e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,14 +12,6 @@ notifications: cache: npm deploy: - - provider: releases - skip_cleanup: true - api_key: - secure: "txBAvszimYY9QqenZckMI+fC/qhnsD4zAUcULs/8D8rGaW7+lCGClV0MShh5T8o/aVbSRctFaHeEESGAuedxmETsQnkBe1XekE1WiXqADzcOp5rrfzIZruED50Zy9dafZGHNJVJax1J1BPb2GePhYg51WX/0OuKb0h5J5tZQvLXVHhtc5hNx5/0kzQNQpyjf8MA/MdZj/Qh5wPx8eKmdt+yTUfqFyzYwh7nE2U+KsHzC5CZdwGXnqZBsWqrNX+l35oFcAu7M7kIzm5RRugrqpmQQqMNDVka1cj3UW0VWve7V5IcnQCfRnat7wXKLPEmC/tBUB3LNRi4X+YKxkkcRaFStJeJw5sQhEK10Jso71p35u0X/AyNVQfzMZou1fFrJsqNGmlB9c/n4zHyepY6jOpEQDBiggvCcf0lvPrJmJvKW9+8HhVBlf9Pre1TmsAciw2jjIrClaTIF/vYk7C/ix37OcMVrijoH8yMOZEZLvpXJhLN/IMvLHyxduvO7ClzT4eWNSoduyZvYB8kGz5OIml7gCtSLQ0qM1We8u5lHTHhqFHChFlgK2F90NBaZV4U1DkxerQgY+EiCVrrDPHAcHmliKgzzYqBfOxsfCJ/odBwg+ASGBy+yLFpCTw5OB1Ap+fvwInz1eQQ0rTP44+24Kt0Nt4lJcFQp3bE+xyzUdk0=" - on: - tags: true - all_branches: true - - provider: script skip_cleanup: true script: bash -ex ./scripts/deploy_on_k8s.sh diff --git a/README.md b/README.md index cd6f8dc..e77b979 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ If you're a developer and want to contribute to, or want to utilize this marketp - [🛳 Production](#-production) - [👩‍🔬 Testing](#-testing) - [🎁 Contributing](#-contributing) -- [⬆️ Bumping version](#-bumping-version) +- [⬆️ Releases](#️-releases) - [✨ Code Style](#-code-style) - [🏛 License](#-license) @@ -82,14 +82,25 @@ Launches the test runner in the interactive watch mode. See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation. -## ⬆️ Bumping version +## ⬆️ Releases -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` +Running any release task does the following: -After that, you need to commit, push and git tag the commit if desired/needed. +- bumps the project version +- creates a Git tag +- updates CHANGELOG.md file with commit messages +- commits and pushes everything +- creates a GitHub release with commit messages as description + +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` + +By creating the Git tag with these tasks, Travis will trigger a new Kubernetes deployment automatically aftr 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) ## ✨ Code Style diff --git a/bumpversion.sh b/bumpversion.sh deleted file mode 100755 index 4c9ad5a..0000000 --- a/bumpversion.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/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 diff --git a/package.json b/package.json index 878f927..8e45000 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,11 @@ "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": "npm run changelog && git add . && git commit -m 'update changelog' && ./node_modules/release-it/bin/release-it.js --src.tagName='v%s' --github.release --non-interactive --no-npm.publish", - "release-minor": "npm run changelog && git add . && git commit -m 'update changelog' && ./node_modules/release-it/bin/release-it.js minor --src.tagName='v%s' --github.release --non-interactive --no-npm.publish", - "release-major": "npm run changelog && git add . && git commit -m 'update changelog' && ./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --non-interactive --no-npm.publish", - "changelog": "auto-changelog" + "release": "./node_modules/release-it/bin/release-it.js --src.tagName='v%s' --github.release --non-interactive --no-npm.publish", + "release-minor": "./node_modules/release-it/bin/release-it.js minor --src.tagName='v%s' --github.release --non-interactive --no-npm.publish", + "release-major": "./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --non-interactive --no-npm.publish", + "changelog": "auto-changelog", + "beforeStage": "npm run changelog" }, "dependencies": {}, "devDependencies": {