I'm trying to configure automation release deployment to Github releases with Travis CI build. My .travis.yml
file looks like:
language: java
jdk: oraclejdk8
branches:
only:
- master
before_install: mvn package -DskipTests=true -DbuildNumber=$TRAVIS_BUILD_NUMBER
before_deploy:
- git config --local user.name "$USER_NAME"
- git config --local user.email "$USER_EMAIL"
- export GIT_TAG=1.0.$TRAVIS_BUILD_NUMBER
- git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER"
- git push origin $GIT_TAG
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file:
- target/tweetsched-dto-1.0.$TRAVIS_BUILD_NUMBER.jar
name: tweetsched-dto-1.0.$TRAVIS_BUILD_NUMBER
skip-cleanup: true
on:
tags: true
repo: Tweetsched/tweetsched-dto
branches:
only:
- master
notifications:
email:
on_success: never
on_failure: always
And what I want - PR is merged to Master branch Travis CI create a new tag in before_deploy
step and then create new release according to that tag. But when I test it I always get a message in Travis CI logs:
Skipping a deployment with the releases provider because this is not a tagged commit
There are no any messages about why it doesn't create tags. What am I doing wrong? And how correctly to configure Travis to release new versions of artifact on successful builds from Master branch?