From 99eae7e36e4176ca8f72bdfe198a3b5ff1808a3a Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:06:15 -0800 Subject: [PATCH] SBT: update resolvers, add `isCI` --- .github/workflows/ci.yml | 2 +- build.sbt | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8228205..bf60b405 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: "16" diff --git a/build.sbt b/build.sbt index bd65e105..22a66467 100644 --- a/build.sbt +++ b/build.sbt @@ -16,6 +16,8 @@ def allScalaVersions = scala2Versions :+ scala3 def scalajsBinaryVersion = "1" def scalajsDom = "2.0.0" +def isCI = System.getenv("CI") != null + def isScala2(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) def isScala212(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 12) def isScala213(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 13) @@ -78,7 +80,7 @@ def crossSetting[A]( inThisBuild( List( version ~= { dynVer => - if (System.getenv("CI") != null) dynVer + if (isCI) dynVer else { import scala.sys.process._ // drop `v` prefix @@ -108,9 +110,11 @@ inThisBuild( ), testFrameworks := List(new TestFramework("munit.Framework")), resolvers ++= Resolver.sonatypeOssRepos("public"), + resolvers ++= Resolver.sonatypeOssRepos("releases"), + resolvers ++= Resolver.sonatypeOssRepos("snapshots"), // faster publishLocal: - packageDoc / publishArtifact := "true" == System.getenv("CI"), - packageSrc / publishArtifact := "true" == System.getenv("CI"), + packageDoc / publishArtifact := isCI, + packageSrc / publishArtifact := isCI, turbo := true, useSuperShell := false // overlaps with MUnit test failure reports. )