Skip to content

Commit

Permalink
Disable CI snapshots if publshing to Central host
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Aug 20, 2024
1 parent 7850a9b commit dbd53fa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import de.heikoseeberger.sbtheader.HeaderPlugin
import org.typelevel.sbt.gha.GenerativePlugin
import org.typelevel.sbt.gha.GitHubActionsPlugin
import sbt._
import xerial.sbt.Sonatype

import Keys._
import TypelevelKernelPlugin.autoImport._
Expand Down Expand Up @@ -48,8 +49,10 @@ object TypelevelPlugin extends AutoPlugin {
import TypelevelCiPlugin.autoImport._
import TypelevelSettingsPlugin.autoImport._
import TypelevelSonatypeCiReleasePlugin.autoImport._
import TypelevelVersioningPlugin.autoImport._
import GenerativePlugin.autoImport._
import GitHubActionsPlugin.autoImport._
import Sonatype.autoImport._

override def buildSettings = Seq(
organization := "org.typelevel",
Expand All @@ -64,7 +67,14 @@ object TypelevelPlugin extends AutoPlugin {
licenses += License.Apache2,
tlCiHeaderCheck := true,
tlCiScalafmtCheck := true,
tlCiReleaseBranches := Seq("main"),
tlCiReleaseBranches := {
val central =
sonatypeCredentialHost.value.equalsIgnoreCase(Sonatype.sonatypeCentralHost)
if (central && tlUntaggedAreSnapshots.value)
Seq() // Sonatype Central does not support snapshots
else
Seq("main")
},
Def.derive(tlFatalWarnings := githubIsWorkflowBuild.value),
githubWorkflowJavaVersions := {
Seq(JavaSpec.temurin(tlJdkRelease.value.getOrElse(8).toString))
Expand Down

0 comments on commit dbd53fa

Please sign in to comment.