Hi,
I’m using Travis CI on a public GitHub repo and deploying files to GitHub releases, when I’m setting up the deployment, I simplify use this command:
$ travis setup --org --force
and follow up the wizard.
It creates a personal token on GitHub and deployment codes in .travis.yml:
deploy:
name: ${VERSION}
body: Relaese body
prerelease: true
provider: releases
api_key:
secure: rvV6A3CK...kGi0=
file: app/build/outputs/apk/release/app.apk
on:
repo: Trumeet/MiPushTester
You can view it on GitHub
Unfortunately, the build always says Unauthorized:
Installing deploy dependencies
invalid options: -SHN
(invalid options are ignored)
Successfully installed .....
Preparing deploy
No stash entries found.
/home/travis/.rvm/gems/ruby-2.4.1/gems/octokit-4.6.2/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/user: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)
I have no idea about this, could everyone help me? Thanks.
I now see that you are running your builds on https://travis-ci.com. This necessitates that you pass --pro flag when you are interacting with travis CLI. Try running
travis encrypt -r Trumeet/MiPushTester --pro
to encrypt your API key, and replacing the secure key-value pair.