Skip to content

Commit

Permalink
Merge pull request #74 from target/remove-artifactory
Browse files Browse the repository at this point in the history
Removes artifactory configuration, explicitly publish to GHP
  • Loading branch information
colindean committed Jan 12, 2022
2 parents 368a938 + a85314f commit 52230a4
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ val circeVersion = "0.10.0"
//addDependencyTreePlugin
enablePlugins(GitVersioning)
git.useGitDescribe := true
ThisBuild / versionScheme := Some("early-semver")

val artifactoryUrl: Option[java.net.URL] = sys.env.get("ARTIFACTORY_URL").map(new java.net.URL(_))

// Publish info
publishTo := artifactoryUrl.map(url =>"Artifactory Realm" at url.toString)
/////////////
// Publishing
/////////////
githubOwner := "target"
githubRepository := "data-validator"
// this unfortunately must be set strangely because GitHub requires a token for pulling packages
// and sbt-github-packages does not allow the user to configure the resolver not to be used.
// https://github.com/djspiewak/sbt-github-packages/issues/28
githubTokenSource := (
TokenSource.Environment("GITHUB_TOKEN") ||
TokenSource.GitConfig("github.token") ||
TokenSource.Environment("SHELL") ) // it's safe to assume this exists and is not unique

credentials ++= (
for {
artifactoryUsername <- sys.env.get("ARTIFACTORY_USERNAME")
artifactoryPassword <- sys.env.get("ARTIFACTORY_PASSWORD")
url <- artifactoryUrl
} yield Credentials(
"Artifactory Realm",
url.getHost,
artifactoryUsername,
artifactoryPassword
)
).toSeq
publishTo := githubPublishTo.value

enablePlugins(BuildInfoPlugin)
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
Expand Down Expand Up @@ -62,14 +60,3 @@ scalastyleFailOnWarning := true
scalastyleFailOnError := true
compileScalastyle := (Compile / scalastyle).toTask("").value
(Compile / compile) := ((Compile / compile) dependsOn compileScalastyle).value

// Publishing
githubOwner := "target"
githubRepository := "data-validator"
// this unfortunately must be set strangely because GitHub requires a token for pulling packages
// and sbt-github-packages does not allow the user to configure the resolver not to be used.
// https://github.com/djspiewak/sbt-github-packages/issues/28
githubTokenSource := ( TokenSource.Environment("GITHUB_TOKEN") ||
TokenSource.GitConfig("github.token") ||
TokenSource.Environment("SHELL") ) // it's safe to assume this exists and is not unique

0 comments on commit 52230a4

Please sign in to comment.