@@ -78,6 +78,8 @@ lazy val commonSettings: List[Def.Setting[_]] = List(
7878
7979lazy val ciReleaseCont = {
8080 commands += Command .command(" ci-release-cont" ) { currentState =>
81+ val version = CiReleasePlugin .getVersion(currentState)
82+ val isSnapshot = CiReleasePlugin .isSnapshotVersion(version)
8183 if (! CiReleasePlugin .isSecure) {
8284 println(" No access to secret variables, doing nothing" )
8385 currentState
@@ -90,14 +92,19 @@ lazy val ciReleaseCont = {
9092 // https://github.com/olafurpg/sbt-ci-release/issues/64
9193 val reloadKeyFiles =
9294 " ; set pgpSecretRing := pgpSecretRing.value; set pgpPublicRing := pgpPublicRing.value"
95+
96+ val publishCommand = CiReleasePlugin .getPublishCommand(currentState)
97+
9398 if (! CiReleasePlugin .isTag && ! git.gitCurrentBranch.value.contains(" master" )) {
94- if (CiReleasePlugin .isSnapshotVersion(version.value) ) {
99+ if (isSnapshot ) {
95100 println(s " No tag push, publishing SNAPSHOT " )
96101 reloadKeyFiles ::
102+ sys.env.getOrElse(" CI_CLEAN" , " ; clean" ) ::
103+ // workaround for *.asc.sha1 not being allowed
97104 sys.env.getOrElse(" CI_SNAPSHOT_RELEASE" , " +publish" ) ::
98105 currentState
99106 } else {
100- // Happens when a tag is pushed right after merge causing the master branch
107+ // Happens when a tag is pushed right after merge causing the main branch
101108 // job to pick up a non-SNAPSHOT version even if TRAVIS_TAG=false.
102109 println(
103110 " Snapshot releases must have -SNAPSHOT version number, doing nothing" ,
@@ -107,9 +114,9 @@ lazy val ciReleaseCont = {
107114 } else {
108115 println(" Tag push detected, publishing a stable release" )
109116 reloadKeyFiles ::
110- sys.env.getOrElse(" CI_CLEAN" , " ; clean ; sonatypeBundleClean " ) ::
111- sys.env.getOrElse( " CI_RELEASE " , " +publishSigned " ) ::
112- sys.env.getOrElse(" CI_SONATYPE_RELEASE" , " sonatypeBundleRelease " ) ::
117+ sys.env.getOrElse(" CI_CLEAN" , " ; clean" ) ::
118+ publishCommand ::
119+ sys.env.getOrElse(" CI_SONATYPE_RELEASE" , " sonaRelease " ) ::
113120 currentState
114121 }
115122 }
0 commit comments