Skip to content

Commit 52230a4

Browse files
authored
Merge pull request #74 from target/remove-artifactory
Removes artifactory configuration, explicitly publish to GHP
2 parents 368a938 + a85314f commit 52230a4

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

build.sbt

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,22 @@ val circeVersion = "0.10.0"
1010
//addDependencyTreePlugin
1111
enablePlugins(GitVersioning)
1212
git.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

3230
enablePlugins(BuildInfoPlugin)
3331
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
@@ -62,14 +60,3 @@ scalastyleFailOnWarning := true
6260
scalastyleFailOnError := true
6361
compileScalastyle := (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

Comments
 (0)