Skip to content

Commit 127f525

Browse files
authored
Add extra logging on Scala CLI artifacts publishing (#3745)
1 parent cba3a2d commit 127f525

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

build.mill.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,11 @@ object `local-repo` extends LocalRepo {
13441344

13451345
// Helper CI commands
13461346
def publishSonatype(tasks: mill.main.Tasks[PublishModule.PublishData]) = Task.Command {
1347+
val taskNames = tasks.value.map(_.toString())
1348+
System.err.println(
1349+
s"""Tasks producing artifacts to be included in the bundle:
1350+
| ${taskNames.mkString("\n ")}""".stripMargin
1351+
)
13471352
val pv = finalPublishVersion()
13481353
System.err.println(s"Publish version: $pv")
13491354
val bundleName = s"$organization-$ghName-$pv"

project/publish/package.mill.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.lumidion.sonatype.central.client.core.{PublishingType, SonatypeCreden
66
import settings.{PublishLocalNoFluff, workspaceDirName}
77
import de.tobiasroeser.mill.vcs.version._
88
import mill._
9+
import mill.javalib.publish.Artifact
910
import scalalib._
1011
import org.eclipse.jgit.api.Git
1112

@@ -166,20 +167,23 @@ def publishSonatype(
166167
val pgpPassword = sys.env("PGP_PASSWORD")
167168
val timeout = 10.minutes
168169

169-
val artifacts = data.map {
170+
System.err.println("Actual artifacts included in the bundle:")
171+
val artifacts: Seq[(Seq[(os.Path, String)], Artifact)] = data.map {
170172
case PublishModule.PublishData(a, s) =>
173+
System.err.println(s" ${a.group}:${a.id}:${a.version}")
171174
(s.map { case (p, f) => (p.path, f) }, a)
172175
}
173176

174177
val isRelease: Boolean = {
175-
val versions = artifacts.map(_._2.version).toSet
176-
val set = versions.map(!_.endsWith("-SNAPSHOT"))
178+
val versions: Set[String] = artifacts.map(_._2.version).toSet
179+
val set: Set[Boolean] = versions.map(!_.endsWith("-SNAPSHOT"))
177180
assert(
178181
set.size == 1,
179182
s"Found both snapshot and non-snapshot versions: ${versions.toVector.sorted.mkString(", ")}"
180183
)
181184
set.head
182185
}
186+
System.err.println(s"Is release: $isRelease")
183187
val publisher = new SonatypeCentralPublisher(
184188
credentials = credentials,
185189
gpgArgs = Seq(
@@ -200,8 +204,10 @@ def publishSonatype(
200204
env = env,
201205
awaitTimeout = timeout.toMillis.toInt
202206
)
203-
val publishingType = if (isRelease) PublishingType.AUTOMATIC else PublishingType.USER_MANAGED
207+
val publishingType = if (isRelease) PublishingType.AUTOMATIC else PublishingType.USER_MANAGED
208+
System.err.println(s"Publishing type: $publishingType")
204209
val finalBundleName = if (bundleName.nonEmpty) Some(bundleName) else None
210+
System.err.println(s"Final bundle name: $finalBundleName")
205211
publisher.publishAll(
206212
publishingType = publishingType,
207213
singleBundleName = finalBundleName,

0 commit comments

Comments
 (0)