Skip to content

Commit

Permalink
build(shared): add release plugins and semantic-release support (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
abalias committed Oct 26, 2022
1 parent 66a2436 commit 25be1b3
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 4 deletions.
Empty file added shared/CHANGELOG.md
Empty file.
29 changes: 25 additions & 4 deletions shared/build.sbt
@@ -1,17 +1,38 @@
import sbtbuildinfo.BuildInfoPlugin
import sbtbuildinfo.BuildInfoPlugin.autoImport._
import Dependencies._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

ThisBuild / version := "0.1.0"

ThisBuild / scalaVersion := "3.1.3"
inThisBuild(
Seq(
organization := "io.iohk.atala",
scalaVersion := "3.2.0",
fork := true,
run / connectInput := true,
versionScheme := Some("semver-spec"),
githubOwner := "input-output-hk",
githubRepository := "atala-prism-building-blocks",
githubTokenSource := TokenSource.Environment("GITHUB_TOKEN")
)
)

lazy val root = (project in file("."))
.settings(
organization := "io.iohk.atala",
organizationName := "Input Output HK",
organizationName := "Input Output Global",
buildInfoPackage := "io.iohk.atala.shared",
name := "shared",
crossPaths := false,
libraryDependencies ++= dependencies
).enablePlugins(BuildInfoPlugin)

// ### ReleaseStep ###
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
publishArtifacts,
setNextVersion
)
55 changes: 55 additions & 0 deletions shared/package.json
@@ -0,0 +1,55 @@
{
"name": "shared",
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"conventional-changelog-conventionalcommits": "^5.0.0",
"gradle-semantic-release-plugin": "1.7.3",
"husky": "^8.0.1",
"pinst": "^3.0.0",
"prettier": "^2.7.1",
"semantic-release": "^19.0.3",
"semantic-release-monorepo": "^7.0.5"
},
"extends": "semantic-release-monorepo",
"release": {
"branches": [
{
"name": "main"
},
{
"name": "prerelease/shared",
"prerelease": "snapshot"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "sbt \"release release-version ${nextRelease.version} next-version ${nextRelease.version}-SNAPSHOT with-defaults\""
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"version.sbt",
"CHANGELOG.md"
],
"message": "chore(release): cut shared lib ${nextRelease.version} release [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}
2 changes: 2 additions & 0 deletions shared/project/plugins.sbt
@@ -1,3 +1,5 @@
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
1 change: 1 addition & 0 deletions shared/version.sbt
@@ -0,0 +1 @@
ThisBuild / version := "0.1.0-SNAPSHOT"

0 comments on commit 25be1b3

Please sign in to comment.