-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(prism-agent): automate release process (#109)
* 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
Showing
5 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) | ||
|
@@ -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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
} | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |