Skip to content

Commit c44b12b

Browse files
committed
Fix
1 parent 579cf20 commit c44b12b

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/publish-release-scala.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
PGP_SECRET: ${{ secrets.SIGNING_KEY }}
2222
SONATYPE_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
2323
SONATYPE_USERNAME: ${{ secrets.MAVEN_USERNAME }}
24+
BUILD_RELEASE: true

build.sbt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import java.io.FileInputStream
22
import java.util.Properties
33
import sbt.ThisBuild
4+
import scala.sys.process.Process
45

56
val scala3Version = "3.3.7"
67
val scala2Version = "2.13.18"
@@ -130,10 +131,14 @@ lazy val root = project
130131
publishLocalGradleDependencies := {
131132
import scala.sys.process.*
132133
val rootDir = (ThisBuild / baseDirectory).value
133-
val command = Process(
134-
"./gradlew" :: "publishToMavenLocal" :: Nil,
135-
rootDir
136-
)
134+
val commandArgs =
135+
List(
136+
List("./gradlew"),
137+
if (!version.value.endsWith("-SNAPSHOT")) List("-PbuildRelease=true") else Nil,
138+
List("publishToMavenLocal")
139+
).flatten
140+
141+
val command = Process(commandArgs, rootDir)
137142
val log = streams.value.log
138143
val exitCode = command ! log
139144
if (exitCode != 0) {

0 commit comments

Comments
 (0)