So I figured out how gradle etc works. I heard about travis CI and got it working. Now the last thing I want to achieve, is to make gradle create jar files of the source folder and to give the file names according to their build number, so that none of the previous files get overwritten. I heard about the GitHub deployment possibillity, but I'm not sure if that's what I need. Is this even possible?
Asked
Active
Viewed 1,260 times
1 Answers
4
Sure that's possible.
According to the docs, you need a section in your .travis.yml
for
deploy
. Specifically, you need to switch it on for when you create a Tag in your repository, and you will need to tell Travis to throw nothing away
prematurely. Quoting the docs for the deploy world snippet:
deploy:
provider: releases
api_key: "GITHUB OAUTH TOKEN"
file: "FILE TO UPLOAD"
skip_cleanup: true
on:
tags: true
Then your second question of how to put version numbers in the binary name: You will want to include file_glob: true
to .travis.yml
(see this question for details).
I am not really familiar with the capablities of Grunt to copy or rename files, but you can always use a shell script containing something along the following lines:
orig=origfile.jar
tag=$(git tag --points-at=$(git rev-parse HEAD))
cp "$orig" "${orig%.jar}_${tag}.jar"