Skip to content

Commit

Permalink
Merge branch 'main' into feature/ATL-1925-define-km-storage-4
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Losoponkul committed Oct 21, 2022
2 parents bd3d99b + 21fe5bc commit 76ecbfc
Show file tree
Hide file tree
Showing 19 changed files with 522 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/mercury.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
- ".github/workflows/mercury.yml"
- "mercury/**"

env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}

defaults:
run:
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
agent
shared
infra
release
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
workflow_dispatch:
inputs:
release-component:
description: "Release component"
required: true
default: "mercury/prism-mediator"
release-branch:
description: "Branch to release from"
required: false
default: "main"

jobs:
release:
env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.release-branch }}
fetch-depth: 0
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: crazy-max/ghaction-import-gpg@v3
id: import_gpg
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
git-user-signingkey: true
git-commit-gpgsign: true
- name: Release
run: |
# Set required environment variables for semantic-release-git
export GIT_AUTHOR_EMAIL="${{ steps.import_gpg.outputs.email }}"
export GIT_COMMITTER_EMAIL="${GIT_AUTHOR_EMAIL}"
export GIT_AUTHOR_NAME="${{ steps.import_gpg.outputs.name }}"
export GIT_COMMITTER_NAME="${GIT_AUTHOR_NAME}"
# Install and run release process
cd ${{ github.event.inputs.release-component }}
npm install
npx semantic-release -e semantic-release-monorepo
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ target
**/.DS_Store
shell.nix
.envrc
node_modules/
package-lock.json
55 changes: 54 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ As a contributor, here are the guidelines we would like you to follow:

- [Pull Requests](#pr)
- [Commit Message Guidelines](#commit)
- [Release process](#release)
- Software development lifecycle (TBD)
- Release process (TBD)


## <a name="pr"></a> Pull Requests
Expand Down Expand Up @@ -221,5 +221,58 @@ Initialization:
> Please note: even if local `pre-commit` set-up is not in use
> all violations will be found during CI jobs execution for a PR
## <a name="release"></a> Releases

Release process of all Atala PRISM components is automated via [Semantic Release](#semantic-release) tool
with help of additional `gradle` or `sbt` library specific plugins.

[Semantic Release](#semantic-release) automates the whole package release workflow including: determining the next version number, generating the release notes, and publishing the package.

This removes the immediate connection between human emotions and version numbers, strictly following the Semantic Versioning specification and communicating the impact of changes to consumers.

General release steps for each building block include:
1. Analyze and filter conventional commits for each component to automatically identify the next semantic version for it
2. Generate release notes based on changes in the component
3. Build, test, and publish packages
4. Update `CHANGELOG.md`
5. Create tag and release

For more specific details about the release process of each component, please, check `README.md` for each building block in the corresponding directory.

### Prereleases

Special branches named `prerelease/<building-block>` exist to generate pre-releases of libraries.

If a release is triggered from a `prerelease/*` branch, then a special pre-release version of libraries will be published with additional `prerelease/<building-block>` suffix that can be used to test a product before the publication of a main version.

### Triggering a release

Special [release workflow](.github/workflows/release.yml) exists to start release generation for a component / building block.

It has the following parameters:
* `release-component`: a component to release
* `release-branch`: branch to release from

By default, `release-branch` is always `main`.

To trigger a new release generation, follow the next steps:
1. Go to https://github.com/input-output-hk/atala-prism-building-blocks/actions
2. Choose `Release` workflow on the left panel of all available workflows
3. Choose `Run workflow` on the pop-up
4. Specify input parameters - component and branch
5. Press `Run workflow` green button

If all release conditions are met, then a new release will be published.

> Please note: release won't be published if branch does not correspond to `main` or `prerelease/*`, or if there were no changes for a component since the latest release
To check the next version and dry-run on local environment, use the following commands:
```shell
cd <component_dir>
npm install
npx semantic-release -e semantic-release-monorepo --dry-run
```

[pr_guidelines]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request
[conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/#specification
[semantic-release]: https://semantic-release.gitbook.io/semantic-release/
11 changes: 11 additions & 0 deletions mercury/prism-mediator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# mercury-v0.1.0 (2022-10-21)

### Features

* infra: [ATL-1889] create local deployment config (3f381cd (https://github.com/input-output-hk/atala-prism-building-blocks/commit/3f381cdcb7b8abe9082dc4d36a44e89e47b1d0af))
* mercury: Coordinate Mediation Protocol (#33 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/33)) (a3ee0d3 (https://github.com/input-output-hk/atala-prism-building-blocks/commit/a3ee0d341a921f39610071eb473d11ceaed0b0e0))
* mercury: Expose open api-spec for mediator (#38 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/38)) (fdad327 (https://github.com/input-output-hk/atala-prism-building-blocks/commit/fdad3275d3c2a8c70c43999f5dac78751db0bc70))
* mercury: Mercury Mailbox Mediator Demo (#16 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/16)) (27fc9dc (https://github.com/input-output-hk/atala-prism-building-blocks/commit/27fc9dc61c6494dec62b81314b544938fb7c52ca))
* mercury: New CI workflow for mercury and fixes (#57 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/57)) (43ad49a (https://github.com/input-output-hk/atala-prism-building-blocks/commit/43ad49a0c0188dc7db5300c1e32043db10e683e7))
* mercury: New CLI Agent for mercury (#56 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/56)) (5be9c2c (https://github.com/input-output-hk/atala-prism-building-blocks/commit/5be9c2cd0d672ab59f010a5879b745eca65fbf10))
* mercury: Report Problem Protocol (#21 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/21)) (f5a3711 (https://github.com/input-output-hk/atala-prism-building-blocks/commit/f5a3711da0de2ab2af50facb7e69680882920b6d))
67 changes: 46 additions & 21 deletions mercury/prism-mediator/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

val tapirVersion = "1.0.3"
val VERSION = "0.1.0-SNAPSHOT"

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

Expand Down Expand Up @@ -71,7 +77,7 @@ lazy val D = new {
*/
lazy val models = project
.in(file("models"))
.settings(name := "mercury-data-models", version := VERSION)
.settings(name := "mercury-data-models")
.settings(
libraryDependencies ++= Seq(D.zio.value),
libraryDependencies ++= Seq(
Expand All @@ -89,22 +95,29 @@ lazy val models = project

lazy val protocolConnection = project
.in(file("protocol-connection"))
.settings(name := "mercury-protocol-connection", version := VERSION)
.settings(name := "mercury-protocol-connection")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.dependsOn(models, protocolInvitation)

lazy val protocolCoordinateMediation = project
.in(file("protocol-coordinate-mediation"))
.settings(name := "mercury-protocol-coordinate-mediation", version := VERSION)
.settings(name := "mercury-protocol-coordinate-mediation")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.settings(libraryDependencies += D.munitZio.value)
.dependsOn(models)

lazy val protocolDidExchange = project
.in(file("protocol-did-exchange"))
.settings(name := "mercury-protocol-did-exchange")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.dependsOn(models, protocolInvitation)

lazy val protocolInvitation = project
.in(file("protocol-invitation"))
.settings(name := "mercury-protocol-invitation", version := VERSION)
.settings(name := "mercury-protocol-invitation")
.settings(libraryDependencies += D.zio.value)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -117,22 +130,15 @@ lazy val protocolInvitation = project
)
.dependsOn(models)

lazy val protocolDidExchange = project
.in(file("protocol-did-exchange"))
.settings(name := "mercury-protocol-did-exchange", version := VERSION)
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.dependsOn(models, protocolInvitation)

lazy val protocolMercuryMailbox = project
.in(file("protocol-mercury-mailbox"))
.settings(name := "mercury-protocol-mailbox", version := VERSION)
.settings(name := "mercury-protocol-mailbox")
.settings(libraryDependencies += D.zio.value)
.dependsOn(models, protocolInvitation, protocolRouting)

lazy val protocolLogin = project
.in(file("protocol-outofband-login"))
.settings(name := "mercury-protocol-outofband-login", version := VERSION)
.settings(name := "mercury-protocol-outofband-login")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
Expand All @@ -141,13 +147,21 @@ lazy val protocolLogin = project

lazy val protocolReportProblem = project
.in(file("protocol-report-problem"))
.settings(name := "protocol-report_problem", version := VERSION)
.settings(name := "protocol-report-problem")
.dependsOn(models)

lazy val protocolRouting = project
.in(file("protocol-routing"))
.settings(name := "mercury-protocol-routing-2_0", version := VERSION)
.settings(name := "mercury-protocol-routing-2-0")
.settings(libraryDependencies += D.zio.value)
.dependsOn(models)

lazy val protocolIssueCredential = project
.in(file("protocol-issue-credential"))
.settings(name := "mercury-protocol-issue-credential")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.settings(libraryDependencies += D.munitZio.value)
.dependsOn(models)

// ################
Expand All @@ -157,7 +171,7 @@ lazy val protocolRouting = project
// TODO move stuff to the models module
lazy val resolver = project // maybe merge into models
.in(file("resolver"))
.settings(name := "mercury-resolver", version := VERSION)
.settings(name := "mercury-resolver")
.settings(
libraryDependencies ++= Seq(
D.didcommx.value,
Expand All @@ -178,7 +192,7 @@ lazy val resolver = project // maybe merge into models

lazy val agent = project // maybe merge into models
.in(file("agent"))
.settings(name := "mercury-agent-core") // , version := VERSION)
.settings(name := "mercury-agent-core")
.settings(libraryDependencies += "com.google.zxing" % "core" % "3.5.0")
.settings(libraryDependencies ++= Seq(D.zioLog.value, D.zioHttp.value)) // , D.zioSLF4J.value))
.dependsOn(
Expand All @@ -194,15 +208,15 @@ lazy val agent = project // maybe merge into models
/** Demos agents and services implementation with didcommx */
lazy val agentDidcommx = project
.in(file("agent-didcommx"))
.settings(name := "mercury-agent-didcommx", version := VERSION)
.settings(name := "mercury-agent-didcommx")
.settings(libraryDependencies += D.didcommx.value)
.dependsOn(agent)

///** TODO Demos agents and services implementation with did-scala */
lazy val agentDidScala =
project
.in(file("agent-did-scala"))
.settings(name := "mercury-agent-didscala", version := VERSION)
.settings(name := "mercury-agent-didscala")
.settings(
didScalaAUX,
if (useDidLib) (Compile / sources ++= Seq())
Expand All @@ -217,7 +231,7 @@ lazy val agentDidScala =
/** The mediator service */
lazy val mediator = project
.in(file("mediator"))
.settings(name := "mercury-mediator", version := VERSION)
.settings(name := "mercury-mediator")
.settings(
libraryDependencies ++= Seq( // TODO cleanup
"com.softwaremill.sttp.tapir" %% "tapir-http4s-server-zio" % tapirVersion,
Expand Down Expand Up @@ -257,4 +271,15 @@ lazy val mediator = project
protocolMercuryMailbox,
protocolReportProblem,
protocolRouting,
protocolIssueCredential
)

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
publishArtifacts,
setNextVersion
)
Loading

0 comments on commit 76ecbfc

Please sign in to comment.