I have been trying to follow the various guides to pushing a release to GitHub, but I am missing some crucial information.
What is required for such a push to work?
This is my .travis.yml
language: java
git:
submodules: false
deploy:
provider: releases
api_key:
secure: JjpBYKmA8ByMiNEXLQcR...
file: target/uSkyBlock.jar
release-number: latest
skip_cleanup: true
on:
tags: true
repo: rlf/uSkyBlock
branch: v2.0.0
all_branches: true
cache:
directories:
- $HOME/.m2
I.e. if I want the CI to push SNAPSHOT releases, what should and what shouldn't I do?
I've tried adding and or removing the on:tags clause, and various other efforts, but regardless, I get the following when trying to deploy:
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-3.7.0/lib/octokit/response/raise_error.rb:16:in
on_complete': GET https://api.github.com/repos/rlf/uSkyBlock/releases/latest: 404 - Not Found // See: https://developer.github.com/v3 (Octokit::NotFound) from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/faraday-0.9.0/lib/faraday/response.rb:9:inblock in call' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/faraday-0.9.0/lib/faraday/response.rb:57:inon_complete' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/faraday-0.9.0/lib/faraday/response.rb:8:incall' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:inbuild_response' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/faraday-0.9.0/lib/faraday/connection.rb:377:inrun_request' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/faraday-0.9.0/lib/faraday/connection.rb:140:inget' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/sawyer-0.6.0/lib/sawyer/agent.rb:94:incall' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-3.7.0/lib/octokit/client.rb:339:inrequest' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-3.7.0/lib/octokit/client.rb:135:inget' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-3.7.0/lib/octokit/client/releases.rb:41:inrelease' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/provider/releases.rb:105:inblock in push_app' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/provider/releases.rb:102:ineach' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/provider/releases.rb:102:inpush_app' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/provider.rb:131:inblock in deploy' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/cli.rb:41:infold' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/provider.rb:131:indeploy' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/cli.rb:32:inrun' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/lib/dpl/cli.rb:7:inrun' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.7.8/bin/dpl:5:in' from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:inload' from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in' failed to deploy
It seems the releases deploy module can't locate my snapshots on GitHub.
So, If I want travis to deploy a continuous test-release to GitHub - what do I have to do? What am I missing?
After absolutely no help on these forums, and no answer on IRC - here is my solution to the problem.
It's a hybrid between "the guide" from travis, and the bits and pieces picked up on various related questions.
travis setup releases
Will do it's best, but for me, something failed, and I couldn't get back on track. So, the solution was:
a) Find and install travis-cli - I managed to do this on my Windows box, though it's way easier on Linux (though, that is kind of needed for the above step, it's still something that needs to be done).
b) Go to the GitHub Settings page under Applications and locate the "automatic releases for rlf/uSkyBlock".
c) Regenerate a new key - and copy it (it will be gone if you don't).
d) Launch the travis-cli, and encrypt the key:
travis encrypt GITHUB_TOKEN=mytokenhere --add
e) Use the environment variable in your .travis.yml
deploy:
api-key: ${GITHUB_TOKEN}
and now it seems to work.
No need to mess with Curl, or the GitHub API - and no need to wait for travis-ci to answer your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With