Skip to content

Commit 716a895

Browse files
tag を打った時の build で version を tag 名にする
1 parent b98a39f commit 716a895

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.circleci/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,12 @@ jobs:
188188
paths:
189189
- "~/.gradle"
190190
- "~/.m2"
191+
192+
workflows:
193+
version: 2
194+
all:
195+
jobs:
196+
- build:
197+
filters:
198+
tags:
199+
only: /.*/

gradle/version.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ version = new SimpleDateFormat('yyyyMMdd').format(new Date()) + "-" + revision +
2121
(git.branch.current.name != "master" ? "-SNAPSHOT" : "") +
2222
(git.status().isClean() ? "" : "+dirty")
2323

24+
if (System.getenv('CIRCLE_TAG') != null) {
25+
version = System.getenv('CIRCLE_TAG')
26+
}
27+
2428
task showVersion {
2529
doLast {
2630
println version

0 commit comments

Comments
 (0)