From 74bc208bc1782b6ef8804c6d29dc7c67a3993552 Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Fri, 5 Oct 2018 13:50:12 +0000 Subject: [PATCH] Add auto-release support Modelled after what @manageiq/react-ui-components does: https://github.com/ManageIQ/react-ui-components/pull/38 + https://github.com/ManageIQ/react-ui-components/pull/84 Fixes #189 --- .travis.yml | 4 +++- package.json | 26 ++++++++++++++++++++++---- scripts/.release.sh | 3 +++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100755 scripts/.release.sh diff --git a/.travis.yml b/.travis.yml index 79fefc893a..8c89277f45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,9 @@ before_install: script: ./scripts/.build.sh -after_success: ./scripts/.coverage.sh +after_success: + - ./scripts/.coverage.sh + - ./scripts/.release.sh notifications: webhooks: diff --git a/package.json b/package.json index bd81050565..81c8194871 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,16 @@ "description": "UI components for ManageIQ project", "main": "index.js", "scripts": { - "start": "webpack --watch", - "test": "karma start", - "prepublish": "webpack || true", "build": "webpack --config webpack.vendor.config.js && webpack -p", "build-dev": "webpack --config webpack.vendor.config.js && webpack", + "build-docs": "jsdoc -c jsdoc-conf.json", "gettext:extract": "yarn run build && angular-gettext-cli --files './+(src|dist)/**/+(*.html|ui-components.js)' --dest './locale/ui-components.pot' --marker-names '__,N_' && yarn gettext:validate", "gettext:validate": "node scripts/validate-gettext-catalog.js", "install-vendor": "webpack --config webpack.vendor.config.js", - "build-docs": "jsdoc -c jsdoc-conf.json" + "prepublish": "webpack || true", + "release": "semantic-release", + "start": "webpack --watch", + "test": "karma start" }, "repository": { "type": "git", @@ -25,7 +26,10 @@ "npm": ">= 3.8.1" }, "devDependencies": { + "@khala/commit-analyzer-wildcard": "~1.0.4", "@manageiq/font-fabulous": "^1.0.0", + "@semantic-release/git": "~7.0.4", + "@semantic-release/npm": "~5.0.4", "@types/angular-mocks": "^1.5.7", "@types/angular-ui-router": "^1.1.35", "@types/jasmine": "^2.5.38", @@ -82,6 +86,7 @@ "rx-angular": "^1.1.3", "sass": "^0.5.0", "sass-loader": "^4.0.2", + "semantic-release": "~15.9.17", "style-loader": "^0.13.1", "tslint": "4.0.2", "tslint-loader": "3.2.0", @@ -100,5 +105,18 @@ "es7-shim": "^6.0.0", "eslint": "~3.9.1", "sprintf-js": "^1.1.1" + }, + "release": { + "analyzeCommits": "@khala/commit-analyzer-wildcard/analyzer", + "prepare": [ + "@semantic-release/npm", + { + "path": "@semantic-release/git", + "assets": [ + "package.json" + ], + "message": "Release of new version: ${nextRelease.version} [skip ci]" + } + ] } } diff --git a/scripts/.release.sh b/scripts/.release.sh new file mode 100755 index 0000000000..0e06d89c2e --- /dev/null +++ b/scripts/.release.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +export GH_TOKEN=$GITHUB_AUTH +npm run release