travis-ci setup releases with --github-token

Here's a route which doesn't involve typing your GitHub password into the terminal. I assume you have the travis CI installed. This assumes you're using travis-ci.org, but replacing --org with --com should work otherwise.

If github.com/your/repo was your repo:

  1. Generate a Github personal access token with the following scope: read:org, public_repo, repo:status, repo_deployment, user:email, write:repo_hook
  2. (Optional?) Login using travis login <github token> --org
  3. Run echo <github token> | travis encrypt --org -r your/repo
  4. Use that secret in your .travis.yml file as described in the documentation

You may need to provide full repo scope, but for the free tier of Travis, public_repo is enough. I'm also not sure which of the other scopes are mandatory.

echo is useful on Windows because Ctrl-D doesn't work properly in Powershell.


The Travis CI CLI will not send the GitHub password to Travis CI, instead it will send it to GitHub and use it to generate a GitHub token (the same is true for travis login).

However, if you still feel uncomfortable, you can configure the deployment manually.

Add the following to your .travis.yml:

deploy:
  provider: releases
  api_key: "GITHUB OAUTH TOKEN"
  file: "FILE TO UPLOAD"
  skip_cleanup: true
  on:
    tags: true
    all_branches: true

You can encrypt the GitHub OAuth token via travis encrypt .... It is not necessary to be logged in via the CLI for this, and the encryption happens locally.

See http://docs.travis-ci.com/user/deployment/releases/ for the full documentation