From 13664fccdd111f0514ac3656efe2a5cb69637d42 Mon Sep 17 00:00:00 2001 From: "Dr. Daniel Alexander Smith" Date: Wed, 26 Jul 2023 17:11:20 +0100 Subject: [PATCH] Publish Maven Repo in build.sbt to GitHub package repo --- data-quality-profiler/build.sbt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/data-quality-profiler/build.sbt b/data-quality-profiler/build.sbt index 68d724b..60f11ca 100644 --- a/data-quality-profiler/build.sbt +++ b/data-quality-profiler/build.sbt @@ -71,10 +71,32 @@ assembly / assemblyMergeStrategy := { case _ => MergeStrategy.first } +// these are all to allow local publishing to overwrite the version +/** make a fat jar */ +artifact in (Compile, assembly) := { + val art = (artifact in (Compile, assembly)).value + art.withClassifier(Some("assembly")) +} +addArtifact(artifact in (Compile, assembly), assembly) +/***/ + + +publishTo := Some(s"GitHub Apache Maven Packages" at s"https://maven.pkg.github.com/${System.getenv("GITHUB_REPOSITORY")}") +credentials += Credentials( + "GitHub Package Registry", + "maven.pkg.github.com", + System.getenv("GITHUB_REPOSITORY_OWNER"), + System.getenv("GITHUB_TOKEN") +) +publishMavenStyle := true +isSnapshot := true + // these are all to allow local publishing to overwrite the version publishConfiguration := publishConfiguration.value.withOverwrite(true) publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true) -isSnapshot := true + +Test / publishArtifact := false + Compile / compile / wartremoverErrors ++= Seq(Wart.IterableOps, Wart.Throw, Wart.Null, Wart.Var, Wart.Return, Wart.OptionPartial, Wart.Any) Compile / compile / wartremoverExcluded += (LocalRootProject / baseDirectory).value / "src" / "test"