Skip to content

Commit 437cb47

Browse files
authored
Merge pull request #347 from adorsys/340-release-update
feat: release workflow
2 parents 53b0bb6 + c1e66f2 commit 437cb47

File tree

6 files changed

+140
-53
lines changed

6 files changed

+140
-53
lines changed

.github/workflows/release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Release Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on tag push like v0.1.0
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: 'Dry run (true/false)'
11+
required: true
12+
default: 'true'
13+
skip_tests:
14+
description: 'Skip tests (true/false)'
15+
required: true
16+
default: 'false'
17+
18+
permissions:
19+
contents: write
20+
21+
env:
22+
CARGO_TERM_COLOR: always
23+
24+
jobs:
25+
build_and_test:
26+
name: Build and Test
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout Repository
30+
uses: actions/checkout@v3
31+
32+
- name: Set up Rust
33+
uses: actions-rust-lang/setup-rust-toolchain@v1
34+
with:
35+
toolchain: stable
36+
37+
- name: Cache Cargo
38+
uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.cargo/registry
42+
~/.cargo/index
43+
target
44+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
45+
46+
- name: Build Project
47+
run: cargo build --release --verbose
48+
49+
- name: Run Tests
50+
if: ${{ github.event.inputs.skip_tests != 'true' }}
51+
run: cargo test --verbose
52+
53+
- name: Save Release Binary
54+
if: startsWith(github.ref, 'refs/tags/v')
55+
run: |
56+
mkdir -p release-artifacts
57+
cp target/release/didcomm-mediator release-artifacts/
58+
chmod +x release-artifacts/didcomm-mediator
59+
60+
- name: Upload Binary Artifact
61+
if: startsWith(github.ref, 'refs/tags/v')
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: didcomm-mediator-binary
65+
path: release-artifacts/
66+
67+
create_release:
68+
name: Create Release
69+
runs-on: ubuntu-latest
70+
needs: build_and_test
71+
if: startsWith(github.ref, 'refs/tags/v')
72+
steps:
73+
- name: Download Binary Artifact
74+
uses: actions/download-artifact@v4.1.8
75+
with:
76+
name: didcomm-mediator-binary
77+
path: release-assets
78+
79+
- name: Create GitHub Release
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
uses: softprops/action-gh-release@v2.1.0
83+
with:
84+
name: Release ${{ github.ref_name }}
85+
draft: false
86+
prerelease: ${{ contains(github.ref_name, 'rc') }}
87+
files: |
88+
release-assets/didcomm-mediator
89+
body: |
90+
## Release ${{ github.ref_name }}
91+
92+
This is the release of **didcomm-mediator-rs**, a Rust implementation of a mediator for the DIDComm v2 protocol.
93+
94+
### Key Features
95+
- Basic Mediation Support for DIDComm v2
96+
- Routing and Keylist Management
97+
- Interoperability with existing SSI infrastructure
98+
- Modular and extensible architecture
99+
- Advanced error handling and transport-layer compliance development
100+
101+
### Getting Started
102+
See the [README](https://github.com/adorsys/didcomm-mediator-rs#readme) for setup and usage instructions.
103+
104+
_This release was automatically generated from tag `${{ github.ref_name }}`._

Cargo.lock

Lines changed: 13 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "didcomm-mediator"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["adorsys GmbH Co. KG"]
55
license = "Apache-2.0"
66
description = "A Rust Mediator for DIDComm messaging, supporting secure and decentralized communication."
@@ -73,9 +73,9 @@ anyhow = "1"
7373
subtle = "2.6.1"
7474
regex = "1.11.1"
7575
mongodb = "3.1.1"
76+
nix = "0.29.0"
7677
once_cell = "1.20.2"
7778
tower = "0.5"
78-
nix = "0.29.0"
7979
uuid = "1.11.0"
8080
axum = "0.7.9"
8181
tokio = "1.42.0"
@@ -105,7 +105,6 @@ aws-sdk-kms = "1.49"
105105
base64ct = { version = "1.6.0", default-features = false }
106106
zeroize = { version = "1.8.1", default-features = false }
107107

108-
109108
[dependencies]
110109
plugin-api.workspace = true
111110

crates/web-plugins/did-endpoint/src/web.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ use did_utils::{
1212
proof::{CryptoProof, EdDsaJcs2022, Proof, PROOF_TYPE_DATA_INTEGRITY_PROOF},
1313
vc::{VerifiableCredential, VerifiablePresentation},
1414
};
15+
16+
#[allow(unused_imports)]
1517
use hyper::StatusCode;
16-
use mongodb::bson::doc;
1718
use multibase::Base;
1819
use serde_json::{json, Value};
1920
use std::{collections::HashMap, path::Path, sync::Arc};

crates/web-plugins/didcomm-messaging/shared/src/breaker.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ use tokio::time::Sleep;
1818
/// This struct implements a circuit breaker pattern, which helps prevent cascading failures when interacting with unreliable services.
1919
/// It monitors the success and failure of operations and transitions between three states:
2020
///
21-
/// * **Closed:** The circuit is operating normally, and operations are allowed to proceed.
22-
/// * **Open:** Operations are immediately rejected without being executed. This prevents overloading the failing service.
23-
/// * **Half-Open:** After a timeout period, the circuit enters a half-open state, allowing a limited number of operations to be executed.
24-
/// If the probe succeeds, the circuit closes; otherwise, it returns to the open state.
21+
/// * **Closed:** The circuit is operating normally, and operations are allowed to proceed.
22+
/// * **Open:** Operations are immediately rejected without being executed. This prevents overloading the failing service.
23+
/// * **Half-Open:** After a timeout period, the circuit enters a half-open state, allowing a limited number of operations to be executed.
24+
/// If the probe succeeds, the circuit closes; otherwise, it returns to the open state.
2525
///
2626
/// By default, the circuit breaker is configured with the following:
2727
///
28-
/// * No retry attempt after a failure.
29-
/// * A default reset timeout of 30 seconds.
30-
/// * One retry attempt in half-open state.
31-
/// * No delay between retries.
28+
/// * No retry attempt after a failure.
29+
/// * A default reset timeout of 30 seconds.
30+
/// * One retry attempt in half-open state.
31+
/// * No delay between retries.
3232
///
3333
/// # Configuration
3434
///
3535
/// The behavior of the circuit breaker can be customized using the following builder methods:
3636
///
37-
/// * [`CircuitBreaker::retries(self, max_retries: usize)`]: Sets the maximum number of consecutive failures allowed before the circuit opens.
38-
/// A value of 0 means the circuit will open on the first failure.
39-
/// * [`CircuitBreaker::half_open_max_failures(self, max_retries: usize)`]: Sets the maximum number of attempts in half-open state
40-
/// before reopening the circuit.
41-
/// * [`CircuitBreaker::reset_timeout(self, reset_timeout: Duration)`]: Sets the duration the circuit remains open after tripping.
42-
/// After this timeout, the circuit transitions to the half-open state.
43-
/// * [`CircuitBreaker::exponential_backoff(self, initial_delay: Duration)`]: Configures an exponential backoff strategy for retries.
44-
/// The delay between retries increases exponentially. This overrides any previously set backoff.
45-
/// * [`CircuitBreaker::constant_backoff(self, delay: Duration)`]: Configures a constant backoff strategy for retries.
46-
/// The delay between retries remains constant. This overrides any previously set backoff.
37+
/// * [`CircuitBreaker::retries(self, max_retries: usize)`]: Sets the maximum number of consecutive failures allowed before the circuit opens.
38+
/// A value of 0 means the circuit will open on the first failure.
39+
/// * [`CircuitBreaker::half_open_max_failures(self, max_retries: usize)`]: Sets the maximum number of attempts in half-open state
40+
/// before reopening the circuit.
41+
/// * [`CircuitBreaker::reset_timeout(self, reset_timeout: Duration)`]: Sets the duration the circuit remains open after tripping.
42+
/// After this timeout, the circuit transitions to the half-open state.
43+
/// * [`CircuitBreaker::exponential_backoff(self, initial_delay: Duration)`]: Configures an exponential backoff strategy for retries.
44+
/// The delay between retries increases exponentially. This overrides any previously set backoff.
45+
/// * [`CircuitBreaker::constant_backoff(self, delay: Duration)`]: Configures a constant backoff strategy for retries.
46+
/// The delay between retries remains constant. This overrides any previously set backoff.
4747
///
4848
/// # Example
4949
///

crates/web-plugins/didcomm-messaging/shared/src/breaker/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::doc_overindented_list_items)]
12
use super::*;
23

34
use std::sync::atomic::{AtomicUsize, Ordering};

0 commit comments

Comments
 (0)