Skip to content

Instantly share code, notes, and snippets.

@namila007
Last active April 29, 2018 15:57
Show Gist options
  • Save namila007/fb724ea6c6e9302eb135bcba249bec6c to your computer and use it in GitHub Desktop.
Save namila007/fb724ea6c6e9302eb135bcba249bec6c to your computer and use it in GitHub Desktop.
Configuration of .travis.yml for maven github release
language: java
#caching directory
cache:
directories:
- /home/travis/build/YOUR_USERNAME/REPO_NAME/target/
- $HOME/.m2
jdk: oraclejdk8
sudo: false # faster builds
script: "mvn install"
before_deploy:
- "mvn -DskipTests package"
deploy:
# GitHub - Add zip to release
- provider: releases
api_key: ${key} #create a key environmental variable in travis and give the Oauth2 key
file: /home/travis/build/USERNAME/REPONAME/target/YOURFILENAME
skip_cleanup: true
on:
tags:
all_branches: true
on_success: always
on_failure: never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment