diff --git a/.travis.yml b/.travis.yml index 323f751a3..e8ee50bd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,15 @@ node_js: - node addons: chrome: stable -script: npm run all \ No newline at end of file +script: npm run all + +jobs: + include: + - stage: release + script: "npm run build && npm run lerna:publish" + +# Conditional stages: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/ +stages: + - test + - name: release + if: branch = master AND fork = false AND tag IS present \ No newline at end of file diff --git a/README.md b/README.md index e9f7fecbd..e65cfa5c3 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,31 @@ Welcome to the mutation testing elements mono repo. -It is a [lernajs](https://lernajs.io/) monorepository. Please see the [packages](https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages) +It is a [lernajs](https://lernajs.io/) mono repository. Please see the [packages](https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages) directory to navigate to a sub package. + +## Versioning + +The `mutation-testing-report-schema` and `mutation-testing-elements` versions will be kept in sync. + +The schema wil only have major and minor releases, as patch releases don't make sense. Backward compatible changes mean a minor version update, breaking changes will mean a major release. + +The mutation-testing-elements major and minor version will be in sync with the schema, however it _can have_ patch releases for changes of the elements without a schema update. + +Note that this is not strict semver 2.0.0. See https://github.com/stryker-mutator/mutation-testing-elements/issues/5 for the reasoning behind it. + +An example (just for clarification, versions are not based on reality): + +| Schema version | Supported mutation-testing-elements implementations | +| ------------- | ------------- | +| `1.0` | `1.0.0`, `1.0.1` | +| `1.1` | `1.0.0`, `1.0.1`, `1.1.0`, `1.1.1` | +| `2.0` | `2.0.0`, `2.0.1` | + +## Releasing + +Releasing is done with from the travis build server. Perform the following steps: + +* Clone the repo and run `npm install`. +* Run `npm run lerna:version:patch`, `npm run lerna:version:minor` or `npm run lerna:version:major` (based on the release you want). Lerna will figure out which packages need to be released and prompt if it is OK. +* After the new tag is pushed to the master branch, it should be released via travis. \ No newline at end of file diff --git a/lerna.json b/lerna.json index 2b3450d05..ead17bec8 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,10 @@ "packages": [ "packages/*" ], - "version": "1.0.0" -} + "version": "1.0.0", + "command": { + "version": { + "allowBranch": "master" + } + } +} \ No newline at end of file diff --git a/package.json b/package.json index 27efd9ebd..b0c73bbf2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,11 @@ "build": "tsc -b && lerna run build", "test": "lerna run test --stream", "start": "webpack-dev-server --open", - "start:tsc": "tsc --build --watch" + "start:tsc": "tsc --build --watch", + "lerna:version:patch": "lerna version --conventional-commits patch", + "lerna:version:minor": "lerna version --conventional-commits minor", + "lerna:version:major": "lerna version --conventional-commits major", + "lerna:publish": "lerna publish from-git" }, "repository": { "type": "git",