@@ -10,24 +10,22 @@ val circeVersion = "0.10.0"
1010// addDependencyTreePlugin
1111enablePlugins(GitVersioning )
1212git.useGitDescribe := true
13+ ThisBuild / versionScheme := Some (" early-semver" )
1314
14- val artifactoryUrl : Option [java.net.URL ] = sys.env.get(" ARTIFACTORY_URL" ).map(new java.net.URL (_))
15-
16- // Publish info
17- publishTo := artifactoryUrl.map(url => " Artifactory Realm" at url.toString)
15+ // ///////////
16+ // Publishing
17+ // ///////////
18+ githubOwner := " target"
19+ githubRepository := " data-validator"
20+ // this unfortunately must be set strangely because GitHub requires a token for pulling packages
21+ // and sbt-github-packages does not allow the user to configure the resolver not to be used.
22+ // https://github.com/djspiewak/sbt-github-packages/issues/28
23+ githubTokenSource := (
24+ TokenSource .Environment (" GITHUB_TOKEN" ) ||
25+ TokenSource .GitConfig (" github.token" ) ||
26+ TokenSource .Environment (" SHELL" ) ) // it's safe to assume this exists and is not unique
1827
19- credentials ++= (
20- for {
21- artifactoryUsername <- sys.env.get(" ARTIFACTORY_USERNAME" )
22- artifactoryPassword <- sys.env.get(" ARTIFACTORY_PASSWORD" )
23- url <- artifactoryUrl
24- } yield Credentials (
25- " Artifactory Realm" ,
26- url.getHost,
27- artifactoryUsername,
28- artifactoryPassword
29- )
30- ).toSeq
28+ publishTo := githubPublishTo.value
3129
3230enablePlugins(BuildInfoPlugin )
3331buildInfoKeys := Seq [BuildInfoKey ](name, version, scalaVersion, sbtVersion)
@@ -62,14 +60,3 @@ scalastyleFailOnWarning := true
6260scalastyleFailOnError := true
6361compileScalastyle := (Compile / scalastyle).toTask(" " ).value
6462(Compile / compile) := ((Compile / compile) dependsOn compileScalastyle).value
65-
66- // Publishing
67- githubOwner := " target"
68- githubRepository := " data-validator"
69- // this unfortunately must be set strangely because GitHub requires a token for pulling packages
70- // and sbt-github-packages does not allow the user to configure the resolver not to be used.
71- // https://github.com/djspiewak/sbt-github-packages/issues/28
72- githubTokenSource := ( TokenSource .Environment (" GITHUB_TOKEN" ) ||
73- TokenSource .GitConfig (" github.token" ) ||
74- TokenSource .Environment (" SHELL" ) ) // it's safe to assume this exists and is not unique
75-
0 commit comments