From ad41c53986661474edf9426980c8096c027aa45a Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Fri, 29 Dec 2017 01:27:03 -0500 Subject: [PATCH] feat: add `travis-deploy-once` CLI --- README.md | 12 +++++------- src/lib/travis.js | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5aed417..06d16d9 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ __semantic-release-cli performs the following steps:__ * Your GitHub username * Your GitHub password (unless passwords were previously saved to keychain) * Which continuous integration system you want to use. (Options: Travis CI / Pro / Enterprise, or Other) - * Whether you want to test a single node.js version (e.g. - 0.12) or multiple node.js versions (e.g. - 0.10, 0.12, etc.) + * Whether you want to test a single node.js version (e.g. - 8) or multiple node.js versions (e.g. - 4, 6, 8, etc.) 1. Save your passwords to your local OS's keychain using [keytar](https://www.npmjs.com/package/keytar) for future use (unless `--no-keychain` was specified) 1. npm Add User * Runs `npm adduser` with the npm information provided to generate a `.npmrc` @@ -55,12 +55,10 @@ __semantic-release-cli performs the following steps:__ * Logs into GitHub using the username and password provided * Creates (and saves for later use) a [GitHub Personal Access Token](https://github.com/settings/tokens) with the following permissions: *repo, read:org, repo:status, repo_deployment, user:email, write:repo_hook* 1. Overwrite your .travis.yml file (if Travis CI was selected) - * `before_install: npm i -g npm@^2.0.0`: install npm 2 - * `before_script: curl -Lo travis_after_all.py https://git.io/vLSON`: install [travis-after-all](https://github.com/travis-ci/travis-ci/issues/929) script to enable running `semantic-release` after ALL build succeed - * `after_success: python travis_after_all.py` and `npm run semantic-release`: run `semantic-release` exactly once after all builds pass - * Set other sane defaults: `sudo: false`, `cache: directories: node_modules`, `notifications: email: false`, `before_script: npm prune` -1. Update your package.json - * Remove `version` field (you don't need it anymore -- `semantic-release` will set the version for you automatically) + * `after_success`: `npm install -g travis-deploy-once` and `travis-deploy-once "npm run semantic-release"`: run `semantic-release` exactly once after all builds pass + * Set other sane defaults: `cache: directories: ~/.npm`, `notifications: email: false` +1. Update your `package.json` + * Set `version` field to `0.0.0-development` (`semantic-release` will set the version for you automatically) * Add a `semantic-release` script: `"semantic-release": "semantic-release"` * Add `semantic-release` as a `devDependency` * Add or overwrite the [`repository` field](https://docs.npmjs.com/files/package.json#repository) diff --git a/src/lib/travis.js b/src/lib/travis.js index fb4f7db..2966705 100644 --- a/src/lib/travis.js +++ b/src/lib/travis.js @@ -20,7 +20,7 @@ const travisyml = { }, // https://github.com/nodejs/Release#release-schedule node_js: ['9', '8', '6', '4'], // eslint-disable-line camelcase - after_success: ['npm run semantic-release'], // eslint-disable-line camelcase + after_success: ['npm install -g travis-deploy-once@4', 'travis-deploy-once "npm run semantic-release"'], // eslint-disable-line camelcase branches: { // ignore git tags created by semantic-release, like "v1.2.3" except: [/^v\d+\.\d+\.\d+$/.toString()],