I'm quite new to Travis CI, but I found my way through it using their docs. However deploying to GitHub releases doesn't work for me.
My .travis.yml
file looks like this:
language: java
branches:
only:
- master
notifications:
email: false
before_deploy:
- export RELEASE_JAR_FILE=$(ls build/libs/*.jar)
- echo "Deploying $RELEASE_JAR_FILE to GitHub"
deploy:
provider: releases
api_key:
secure: [key]
file_glob: true
file: "${RELEASE_JAR_FILE}"
skip_cleanup: true
on:
repo: [my-repo]
tags: true
all_branches: true
Here's how I commit:
$ git add . && git commit -m "my message"
$ git tag 0.1234
$ git push origin --tags
$ git push origin master
After that, Travis creates the build and skips deployment with
Skipping a deployment with the releases provider because this is not a tagged commit
When I open up my GitHub repository in my browser, the releases are tagged correctly, yet Travis doesn't detect them as tagged.
Does anybody have a solution for this? I suspected the branches: only: master
part to be responsible for this behaviour, although Travis once pushed a release to GitHub without the on: tags: true
flag. Afterwards I got errors if I left out the flag saying that I may only push tagged commits as release.