From 34e3e5fd86f09652e36de0957876ea00ef8a5a7a Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Wed, 29 Aug 2018 03:25:53 +0300 Subject: [PATCH] feat(release): replace semantic-release dep with Travis build stages This change moves semantic-release out of dev-dependencies, but keeps its functionality by calling semantic-release as usual in a `release` TravisCI build stage. There are several advantages to this method: 1.) semantic-release is run only after all builds succeed. Our previous approach could have theoretically run semantic-release when some Node.js versions failed with the current code 2.) semantic-release (and it's many dependencies) are removed from `node_modules`. This increases the speed of `npm install` in all cases, and reduces the size of our Docker images by 20MB (from 284MB to 264MB)! Since the only time semantic-release is needed is on TravisCI anyway, it seems pointless that every installation of Pelias should include it. 3.) Because semantic-release is not in `package.json`, Greenkeeper will not attempt to update it. Semantic release updates _very_ frequently, and each update attempt seems to have a decent chance of experiencing a random TravisCI failure, causing unwanted notifications. There are probably downsides to this approach. For example, we should consider pinning the major version of semantic release during install. Additionally, and for obvious reasons, we can't fully test this change until it's merged to the `production` branch. We should consider testing it first on a lower priority repository. If this change _does_ work well, we should consider adopting it everywhere. --- .travis.yml | 7 +++++-- package.json | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5aec4536..e83588fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,11 @@ matrix: script: npm run travis before_install: - npm i -g npm -after_success: - - npx semantic-release branches: except: - /^v\d+\.\d+\.\d+$/ +jobs: + include: + - stage: release + node_js: 10 + script: npx semantic-release diff --git a/package.json b/package.json index 6f2ecf8d..80521db8 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "pelias-mock-logger": "^1.3.0", "precommit-hook": "^3.0.0", "proxyquire": "^2.0.0", - "semantic-release": "^15.1.4", "source-map": "^0.7.0", "tap-dot": "^2.0.0", "tape": "^4.5.1",