Skip to content

Commit

Permalink
build(iris): add release plugins and semantic-release support
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Baliasnikov committed Oct 26, 2022
1 parent 51410d1 commit 66a2436
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 3 deletions.
Empty file.
27 changes: 24 additions & 3 deletions iris/client/scala-client/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import Dependencies._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

ThisBuild / version := "0.1.0"
ThisBuild / scalaVersion := "3.1.3"
ThisBuild / organization := "io.iohk.atala"
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")
)
)

// Custom keys
val apiBaseDirectory = settingKey[File]("The base directory for Iris API specifications")
Expand All @@ -17,3 +27,14 @@ lazy val root = project
Compile / PB.targets := Seq(scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"),
Compile / PB.protoSources := Seq(apiBaseDirectory.value / "grpc")
)

// ### ReleaseStep ###
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
publishArtifacts,
setNextVersion
)
55 changes: 55 additions & 0 deletions iris/client/scala-client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "iris-client",
"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/iris-client",
"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 iris-client ${nextRelease.version} release [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}
2 changes: 2 additions & 0 deletions iris/client/scala-client/project/scalapb.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")

libraryDependencies ++= Seq("com.thesamet.scalapb" %% "compilerplugin" % "0.11.11")
1 change: 1 addition & 0 deletions iris/client/scala-client/version.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ThisBuild / version := "0.1.0-SNAPSHOT"

0 comments on commit 66a2436

Please sign in to comment.