Comments (4)
Hi, thats good input, thanks!
I absolutely agree that we need better documentation, especially for the keychain usage. I would happily review a PR 😄
from cli.
Rather than iterating through pull requests, I figure I would ask for feedback here first. Here's what the new README.md would look like -- please let me know what you think about the format and the accuracy of the information:
semantic-release-cli
Install
npm install -g semantic-release-cli
cd your-module
semantic-release-cli setup
Options
Usage:
semantic-release-cli setup [--tag=<String>]
Options:
-h --help Show this screen.
-v --version Show version.
--[no-]keychain Use keychain to get passwords [default: true].
--ask-for-passwords Ask for the passwords even if passwords are stored [default: false].
--tag=<String> npm tag to install [default: 'latest'].
What it Does
semantic-release-cli performs the following steps:
- Asks for the information it needs. You will need to provide it with:
- Whether your GitHub repository is public or private
- Which NPM registry you want to use (Default: https://registry.npmjs.org/)
- Your NPM username (unless passwords were previously saved to keychain)
- Your NPM email
- Your NPM password
- 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.)
- Save your passwords to your local OS's keychain using keytar for future use (unless
--no-keychain
was specified) - NPM Add User
- Runs
npm adduser
with the npm information provided to generate a.npmrc
- Parses the NPM token from the
.npmrc
for future use
- Runs
- Create GitHub Personal Token
- Logs into GitHub using the username and password provided
- Creates a GitHub Personal Access Token and saves it for future use
- Overwrite your .travis.yml file (if Travis CI was selected)
before_install: npm i -g npm@^2.0.0
: install NPM 2before_script: curl -Lo travis_after_all.py https://git.io/vLSON
: install travis-after-all script to enable runningsemantic-release
after ALL build succeedafter_success: python travis_after_all.py
andnpm run semantic-release
: runsemantic-release
exactly once after all builds pass- Set other sane defaults:
sudo: false
,cache: directories: node_modules
,notifications: email: false
,before_script: npm prune
- Update your package.json
- Remove
version
field (you don't need it anymore --semantic-release
will set the version for you automatically) - Add a
semantic-release
script:"semantic-release": "semantic-release pre && npm publish && semantic-release post"
- Add
semantic-release
as adevDependency
- Add or overwrite the
repository
field
- Remove
- Login to Travis CI to configure the package
- Enable builds of your repo
- Add GH_TOKEN and NPM_TOKEN environment variables in the settings
Other CI Servers
By default, semantic-release-cli
supports the popular Travis CI server. If you select Other
as your server during configuration, semantic-release-cli
will print out the environment variables you need to set on your CI server. You will be responsible for adding these environment variables as well as configuring your CI server to run npm run semantic-release
after all the builds pass.
Note that your CI server will also need to set the environment variable CI=true
so that semantic-release
will not perform a dry run. (Most CI services do this by default.) See the semantic-release
documentation for more details.
License
MIT License
2015 © Christoph Witzko and contributors
from cli.
By the way, that image of the configuration process seems to be really out of date. Could whoever created that one create a new one?
Also, it would be great if those info
messages found their way back into the config process for the sake of UX affordance and safe exploration.
from cli.
Hey @apowers313,
Sorry for the late reply, I didn't really have internet the past week.
First of all thanks so much for this, this is very valuable feedback and a very valuable contribution to the README.md.
Here are my thoughts on this:
keychain caching
First of all I'm apologizing for using this as a default, without being explicit about it. The excitement about this contribution dominated the ability to think about unintended and very unpleasant side effects of this technique.
I think, however, that just reversing the default isn't the best solution. I'd prefer to ask the user whether they'd like to cache their credentials in the keychain on first run, and then persist the answer on the local filesystem, which should be a more convenient way of using it for both choices.
I think it would be a good match to use rc
(I've already successfully used this elsewhere) to read these config files from e.g. the homedir.
It would make sense to persist other things there as well (npm registry, usernames) and adding a --yes
/-y
flag just like npm init
has it, which just runs the whole thing using the defaults. This should get us to the point where we can run the setup w/o a single question on second run.
adding a list of steps to the README.md
This is a very good effort. I already had the list of manual steps in the README.md so it's clear what is necessary/happening, but I'm all for making it even clearer and more detailed. The info logs were never gone though. Following the unix philosophy's rule of silence the default loglevel is set to "warn". Currently the semantic-release-cli is inheriting the loglevel from npm, which means running e.g. npm_config_loglevel=info semantic-release-cli setup
will bring them back at any time. I think that inheriting npm's loglevel is a very good default, but I'm all up for adding an additional loglevel flag so it's possible to set it on the semantic-release-cli level. The updated screenshot is already used in the main repo: https://cloud.githubusercontent.com/assets/908178/9428123/3628dfec-499f-11e5-8bdd-8f3042dd95ed.png
That all being said I think this issue at least addressing two separate things now.
I think it would make most sense to open a PR with the new readme applied, which offers an excellent interface for iterating and giving feedback, before merging it in.
For the defaults and persistent config parts we should open a separate issue.
from cli.
Related Issues (20)
- Error running semantic-release-cli setup , TypeError [ERR_INVALID_ARG_TYPE] HOT 2
- Cli setup failing with Github 2fa account HOT 2
- Github action is triggered twice
- [GitHub] Deprecation Notice HOT 8
- Why does GitHub token require `user:email` and `write:repo_hook` scope? HOT 1
- no access token supplied HOT 10
- ERR! 401 without further info (Travis-CI Pro) HOT 3
- ⚠️ Currently broken due to defunkt Basic Auth APIs HOT 5
- info.github.endpoint is undefined when running npx semantic-release-cli setup HOT 2
- Cannot use arrow keys to choose CI HOT 8
- Cannot setup/init on git-submodule-repo because of non-existent .git/config HOT 2
- xsel: Can't open display: (null)\n: Inappropriate ioctl for device HOT 2
- package-lock.json is not updated HOT 2
- npx semantic-release-cli setup HOT 1
- github actions example uses node version 12 HOT 1
- How to use with NX Monorepo HOT 2
- Error: GitHub repository URL is invalid: https:undefined.git
- semantic-release-cli setup could not get repository url HOT 1
- Babel issue when running npx semantic-release-cli setup HOT 1
- Basic Auth error when trying to attempt a dry-run
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.