Skip to content

Commit 59051d3

Browse files
authored
fix ci-release-cont (#497)
1 parent 3028103 commit 59051d3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
java: [ '8', '11', '17', '21' ]
12+
java: ['8', '11', '17', '21']
1313
steps:
1414
- uses: actions/[email protected]
1515
with:

build.sbt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ lazy val commonSettings: List[Def.Setting[_]] = List(
7878

7979
lazy 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

Comments
 (0)