Skip to content

Commit

Permalink
TAG を打った時の build で version を tag 名にする
Browse files Browse the repository at this point in the history
  • Loading branch information
katagiri-kazumune committed Mar 17, 2020
1 parent e649eba commit 07ef609
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ jobs:
paths:
- "~/.gradle"
- "~/.m2"

workflows:
version: 2
all:
jobs:
- build:
filters:
tags:
only: /.*/
3 changes: 3 additions & 0 deletions gradle/version.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ext {
version = LocalDateTime.now().format("yyyyMMdd") + "-" + revision +
(git.branch.current.name != "master" ? "-SNAPSHOT" : "") +
(git.status().isClean() ? "" : "+dirty")
if (System.getenv('CIRCLE_TAG') != null) {
version = System.getenv('CIRCLE_TAG')
}

task showVersion {
doLast {
Expand Down

0 comments on commit 07ef609

Please sign in to comment.