Skip to content

Commit aae1dca

Browse files
authored
Release from CI (#221)
Release from CI
2 parents 3af39b6 + 31a236a commit aae1dca

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.travis.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
sudo: false
22
language: scala
3-
matrix:
3+
stages:
4+
- name: test
5+
- name: release
6+
if: (branch = master AND type = push) OR (tag IS present)
7+
jobs:
48
include:
59
- env: CMD="mill __.jvm[2.11.12].test"
610
jdk: oraclejdk8
@@ -26,6 +30,12 @@ matrix:
2630
- env: CMD="mill demo.fullOpt && sbt readme/run"
2731
jdk: oraclejdk8
2832

29-
script:
33+
- stage: release
34+
script:
35+
- echo "$PGP_SECRET" | base64 --decode | gpg --import
36+
- mill __.publish --sonatypeCreds "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" --release true --gpgPassphrase "$PGP_PASSPHRASE"
37+
38+
before_install:
3039
- curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.3.6/0.3.6-85-38fce6 && chmod +x ~/bin/mill
40+
script:
3141
- $CMD

build.sc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,14 @@ trait CommonCrossModule extends CrossScalaModule with PublishModule{
151151
def zincWorker: ZincWorkerModule =
152152
CustomZincWorker
153153

154-
def publishVersion = "2.1.0"
154+
def publishVersion = T{
155+
import sys.process._
156+
val desc = Seq("git", "describe", "--tags").!!.trim.replace("-g", "+")
157+
if (desc.contains("+"))
158+
desc + "-SNAPSHOT"
159+
else
160+
desc
161+
}
155162
def artifactName = millModuleSegments.parts.dropRight(2).mkString("-")
156163
def pomSettings = PomSettings(
157164
description = artifactName(),

0 commit comments

Comments
 (0)