Skip to content

Commit

Permalink
Publish to gh and removed bintray plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Jul 30, 2021
1 parent f92ba67 commit 91c012a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 50 deletions.
73 changes: 31 additions & 42 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ credentials +=

licenses += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0"))

githubOwner := "openlawteam"
githubRepository := "openlaw-core"
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource
.Environment("GITHUB_TOKEN") || TokenSource
.Environment("TOKEN")

/*
The Scala and SBT versions must be matched to the version of scala-builder used
as the base image of the container. We try to standardize across projects and
Expand All @@ -50,7 +56,6 @@ lazy val repositories = Seq(
Resolver.jcenterRepo,
Resolver.githubPackages("openlawteam"),
"central" at "https://repo1.maven.org/maven2/",
"scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
"maven central" at "https://mvnrepository.com/repos/central",
Resolver.mavenLocal
)
Expand All @@ -69,55 +74,32 @@ lazy val commonSettings = Seq(
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
)

lazy val publishSettings = Seq(
publishArtifact in (Test, packageBin) := true,
homepage := Some(url(s"https://github.com/$username/$repo")),
licenses += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0")),
scmInfo := Some(
ScmInfo(
url(s"https://github.com/$username/$repo"),
s"git@github.com:$username/$repo.git"
)
),
releaseCrossBuild := true,
developers := List(
Developer(
id = "adridadou",
name = "David Roon",
email = "david.roon@consensys.net",
url = new URL(s"http://github.com/adridadou")
),
Developer(
id = "outkaj",
name = "Jacqueline Outka",
email = "jacqueline@outka.xyz",
url = new URL(s"http://github.com/outkaj")
),
Developer(
id = "openlawbot",
name = "Pizza Dog Bot",
email = "felipe@openlaw.io",
url = new URL(s"http://github.com/openlawbot")
)
)
)
publishTo := Some(
"GitHub Packages OpenLaw Core" at "https://maven.pkg.github.com/openlawteam/openlaw-core"
)

lazy val releaseSettings = releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies, // : ReleaseStep
checkSnapshotDependencies // : ReleaseStep
//inquireVersions, // : ReleaseStep
//setReleaseVersion, // : ReleaseStep
//commitReleaseVersion, // : ReleaseStep, performs the initial git checks
//tagRelease, // : ReleaseStep
//releaseStepCommandAndRemaining("publish"),
publishArtifacts // : ReleaseStep,
//publishArtifacts // : ReleaseStep,
//setNextVersion, // : ReleaseStep
//commitNextVersion, // : ReleaseStep
//pushChanges // : ReleaseStep, also checks that an upstream branch is properly configured
)

publishArtifact in (Test, packageBin) := true
releaseCrossBuild := true
publishMavenStyle := true
publishTo := Some(
"GitHub Packages OpenLaw Core" at "https://maven.pkg.github.com/openlawteam/openlaw-core"
)

publishConfiguration in ThisBuild := publishConfiguration.value.withOverwrite(
true
)
publishLocalConfiguration in ThisBuild := publishLocalConfiguration.value
.withOverwrite(true)

val rules = Seq(
Wart.AnyVal,
Wart.ArrayEquals,
Expand Down Expand Up @@ -239,8 +221,13 @@ lazy val openlawCore = crossProject(JSPlatform, JVMPlatform)
)
.settings(parallelExecution in Test := false)
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
publishTo := Some(
"GitHub Packages OpenLaw Core" at "https://maven.pkg.github.com/openlawteam/openlaw-core"
)
)
.settings(releaseSettings: _*)
.settings(publishMavenStyle := true)
.enablePlugins(WartRemover)

lazy val version = git.gitDescribedVersion
Expand All @@ -253,6 +240,10 @@ addCommandAlias(
"releaseCore",
";project openlawCore ;release release-version ${version} next-version ${version-SNAPSHOT} with-defaults"
)
addCommandAlias(
"publishCore",
";project openlawCore ;publish"
)
addCommandAlias(
"releaseCoreJS",
";project openlawCoreJS ;release release-version ${version} next-version ${version-SNAPSHOT} with-defaults"
Expand All @@ -268,5 +259,3 @@ val root = (project in file("."))
.dependsOn(openlawCoreJvm, openlawCoreJs)
.aggregate(openlawCoreJvm, openlawCoreJs)
.enablePlugins(GitVersioning)

publishMavenStyle := true
13 changes: 5 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
logLevel := Level.Warn

resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"
resolvers += Resolver.url(
"sbt-plugins",
url("https://dl.bintray.com/ssidorenko/sbt-plugins/")
)(Resolver.ivyStylePatterns)
resolvers += Resolver.sonatypeRepo("public")

addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.0")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.2")

/* TODO: potentially move this to global install instead of project-specific */
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.4")

/* ScalaJS related */
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")

/* Release process */
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.7")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.4")
addSbtPlugin("au.com.onegeek" % "sbt-dotenv" % "2.0.117")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")

/* Code coverage */
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
Expand Down

0 comments on commit 91c012a

Please sign in to comment.