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 d954748
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ 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 +50,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 +68,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 d954748

Please sign in to comment.