Skip to content

Commit

Permalink
build(prism-agent): automate release process (#109)
Browse files Browse the repository at this point in the history
* build(prism-agent): automate release process

* build(prism-agent): use ghcr.io and simplify build script
  • Loading branch information
abalias authored Nov 11, 2022
1 parent 1ace5e7 commit b41e3eb
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 11 deletions.
Empty file.
36 changes: 27 additions & 9 deletions prism-agent/service/build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import Dependencies._
import sbtghpackages.GitHubPackagesPlugin.autoImport._

ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "3.2.0"
ThisBuild / organization := "io.iohk.atala"
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

// Custom keys
val apiBaseDirectory = settingKey[File]("The base directory for PrismAgent API specifications")
ThisBuild / apiBaseDirectory := baseDirectory.value / "../api"
ThisBuild / resolvers += Resolver.githubPackages("input-output-hk", "atala-prism-building-blocks")

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

val commonSettings = Seq(
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework")),
githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN"),
resolvers += Resolver.githubPackages("input-output-hk", "atala-prism-sdk"),
resolvers += Resolver.githubPackages("input-output-hk"),
// Needed for Kotlin coroutines that support new memory management mode
resolvers += "JetBrains Space Maven Repository" at "https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven"
)
Expand Down Expand Up @@ -48,10 +57,19 @@ lazy val server = project
.map(model => (model, s"io.iohk.atala.agent.server.http.model.OASModelPatches.$model"))
.toMap,
Docker / maintainer := "[email protected]",
Docker / dockerRepository := Some("atala-prism.io"),
// Docker / packageName := s"atala-prism/${packageName.value}",
Docker / dockerRepository := Some("ghcr.io"),
dockerExposedPorts := Seq(8080),
dockerBaseImage := "openjdk:11"
)
.enablePlugins(OpenApiGeneratorPlugin, JavaAppPackaging, DockerPlugin)
.dependsOn(`wallet-api`)

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
ReleaseStep(releaseStepTask(server / Docker / publish)),
setNextVersion
)
55 changes: 55 additions & 0 deletions prism-agent/service/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "prism-agent",
"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/prism-agent",
"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 prism-agent image ${nextRelease.version} release [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}
4 changes: 2 additions & 2 deletions prism-agent/service/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ object Dependencies {
val zioHttp = "2.0.0-RC11"
val akka = "2.6.20"
val akkaHttp = "10.2.9"
val castor = "0.1.0-SNAPSHOT"
val pollux = "0.1.0-SNAPSHOT"
val castor = "0.1.0"
val pollux = "0.1.0"
val bouncyCastle = "1.70"
val logback = "1.4.4"
}
Expand Down
1 change: 1 addition & 0 deletions prism-agent/service/project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")

libraryDependencies ++= Seq("org.openapitools" % "openapi-generator" % "6.0.0")

0 comments on commit b41e3eb

Please sign in to comment.