From f57f0b479061a67f4935da394fab5a4d0ef871c1 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Wed, 7 Feb 2024 11:37:42 +1100 Subject: [PATCH] Fix versioning and publishing --- build.sbt | 24 +----------------------- project/plugins.sbt | 7 +++---- publish.sbt | 33 ++++++++------------------------- 3 files changed, 12 insertions(+), 52 deletions(-) diff --git a/build.sbt b/build.sbt index f050d89..6719b3e 100644 --- a/build.sbt +++ b/build.sbt @@ -1,30 +1,8 @@ lazy val root = project("paradox-material-theme-parent", file(".")) - .enablePlugins(ParadoxMaterialThemePlugin, GhpagesPlugin, ReleasePlugin) + .enablePlugins(ParadoxMaterialThemePlugin, GhpagesPlugin) .settings( addCommandAlias("verify", "; ^sbt-paradox-material-theme/scripted ; makeSite"), publish / skip := true, - releasePublishArtifactsAction := PgpKeys.publishSigned.value, - releaseTagName := (ThisBuild / version).value, - releaseVersionFile := target.value / "unused-version.sbt", - releaseProcess := { - import ReleaseTransformations._ - Seq[ReleaseStep]( - { st: State => - val v = (ThisBuild / version).value - st.put(ReleaseKeys.versions, (v, v)) - }, - releaseStepTask(makeSite), - releaseStepCommandAndRemaining("^test"), - releaseStepCommandAndRemaining("^sbt-paradox-material-theme/scripted"), - setReleaseVersion, - tagRelease, - releaseStepCommandAndRemaining("paradox-material-theme/publishSigned"), - releaseStepCommandAndRemaining("^sbt-paradox-material-theme/publishSigned"), - // FIXME: releaseStepCommand("sonatypeRelease"), - pushChanges, - releaseStepTask(ghpagesPushSite) - ) - }, ghpagesNoJekyll := true, makeSite / includeFilter := "*.html" | "*.css" | "*.png" | "*.png" | "*.js" | "*.woff" | "*.woff2" | "*.ttf", makeSite / mappings ++= (Compile / paradoxMaterialTheme / mappings).value, diff --git a/project/plugins.sbt b/project/plugins.sbt index e1380d5..00691e3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,8 @@ addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.4.4") addSbtPlugin("com.lightbend.paradox" % "sbt-paradox-theme" % "0.4.4") -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") +addSbtPlugin("com.github.sbt" % "sbt-site" % "1.5.0") +addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") diff --git a/publish.sbt b/publish.sbt index c519e0d..f388af2 100644 --- a/publish.sbt +++ b/publish.sbt @@ -16,32 +16,15 @@ inThisBuild( ) ), developers := List( - Developer("jonas", "Jonas Fonseca", "jonas.fonseca@gmail.com", url("https://github.com/jonas")) - ), - // Workaround NPE when publishing: https://github.com/sbt/sbt/issues/3519 - updateOptions := updateOptions.value.withGigahorse(false), - publishMavenStyle := true, - Test / publishArtifact := false, - pomIncludeRepository := { _ => false }, - publishTo := { - val nexus = "https://oss.sonatype.org/" - if (isSnapshot.value) - Some("snapshots" at nexus + "content/repositories/snapshots") - else - Some("releases" at nexus + "service/local/staging/deploy/maven2") - }, - credentials ++= ( - for { - username <- Option(System.getenv().get("SONATYPE_USERNAME")) - password <- Option(System.getenv().get("SONATYPE_PASSWORD")) - } yield Credentials( - "Sonatype Nexus Repository Manager", - "oss.sonatype.org", - username, - password + Developer("jonas", "Jonas Fonseca", "jonas.fonseca@gmail.com", url("https://github.com/jonas")), + Developer( + "sbt-paradox-material-theme", + "Sbt Paradox Material Theme Contributors", + "", + url("https://github.com/sbt/sbt-multi-jvm/graphs/contributors") ) - ).toSeq, - versionWithGit, + ), + dynverSonatypeSnapshots := true, git.useGitDescribe := true, git.remoteRepo := s"git@github.com:${repo.path}.git" )