Skip to content

Commit 52644bd

Browse files
committed
Introducing versioning concept
1 parent 721e1ef commit 52644bd

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ jdk:
55

66
stages:
77
- test
8-
- name: deploy
9-
if: branch = master
8+
- name: release
9+
if: (branch =~ ^release\/.*$) AND (NOT type = pull_request)
1010

1111
jobs:
1212
include:
1313
- stage: test
1414
script:
1515
- ./gradlew check
16-
- stage: deploy
16+
- stage: release
1717
script:
18-
- ./gradlew clean build publish
18+
- ./gradlew clean build publish
19+
- ./gradlew githubRelease

build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
plugins {
22
id 'java-library'
33
id 'maven-publish'
4+
id 'net.nemerosa.versioning' version '2.8.2'
5+
id "com.github.breadmoirai.github-release" version "2.2.12"
46
}
57

6-
version = '0.0.1-SNAPSHOT'
8+
versioning {
9+
displayMode = 'snapshot' // how to compute version on non-release-branches
10+
dirty = { t -> t }
11+
branchEnv = ['TRAVIS_BRANCH', 'GIT_BRANCH', 'SVN_BRANCH', 'BRANCH_NAME']
12+
}
13+
14+
githubRelease {
15+
token project.hasProperty('githubToken') ? githubToken : System.getenv('GITHUB_TOKEN')
16+
owner "aaaccell"
17+
repo "fixer"
18+
tagName versioning.info.display
19+
targetCommitish versioning.info.commit
20+
body changelog()
21+
prerelease versioning.info.display.contains("-SNAPSHOT") ? true : false
22+
}
23+
24+
version = versioning.info.display
725

826
repositories {
927
jcenter()

0 commit comments

Comments
 (0)