Skip to content

Commit 29375b2

Browse files
authored
Merge pull request #2742 from input-output-hk/jpraynaud/add-cardano-compatibility-release-notes
feat: add Cardano compatibility in release notes
2 parents dc41bc7 + 8ea4cb5 commit 29375b2

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

.github/workflows/actions/prepare-distribution/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ runs:
9494
jq -r '.packages | sort_by(.name) | .[] | select([.name] | inside(["mithril-stm", "mithril-aggregator", "mithril-client", "mithril-client-cli", "mithril-client-wasm", "mithril-signer", "mithril-common"])) | "| \(.name) | `\(.version)` |"' \
9595
>> ./release-notes-addon.txt
9696
97-
- name: Add compatibility table
97+
- name: Add network compatibility table
9898
shell: bash
9999
run: |
100100
cat >> ./release-notes-addon.txt << EOF
@@ -108,6 +108,12 @@ runs:
108108
| jq -r 'keys_unsorted[] as $network | "| \($network) | \(.[$network]) |"' \
109109
>> ./release-notes-addon.txt
110110
111+
- name: Add Cardano node compatibility table
112+
shell: bash
113+
run: |
114+
./.github/workflows/scripts/compute-cardano-compatibility.sh ./networks.json \
115+
>> ./release-notes-addon.txt
116+
111117
- name: Add platform support table
112118
shell: bash
113119
run: |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
JSON_FILE=$1
6+
7+
if [[ ! -f "$JSON_FILE" ]]; then
8+
echo "Error: $JSON_FILE not found!"
9+
exit 1
10+
fi
11+
12+
# Get all unique keys from 'cardano-minimum-version'
13+
MITHRIL_NODES=$(jq -r '[.[] | .["cardano-minimum-version"] | keys[]] | unique | .[]' "$JSON_FILE")
14+
15+
# Create header of the markdown table
16+
header="| Network"
17+
separator="|----------"
18+
19+
for key in $MITHRIL_NODES; do
20+
title=$(echo "$key" | sed 's/-/ /g' | sed 's/\b\w/\U&/g')
21+
header="$header | $title"
22+
separator="$separator |:-------------:"
23+
done
24+
25+
header="$header |"
26+
separator="$separator |"
27+
28+
echo ""
29+
echo "## Cardano Node Compatibility"
30+
echo ""
31+
echo "$header"
32+
echo "$separator"
33+
34+
# Process each top-level network (mainnet, preprod, preview)
35+
for MITHRIL_NETWORK in $(jq -r 'keys[]' "$JSON_FILE"); do
36+
# Get all mithril-networks for this top-level network
37+
jq -r ".\"$MITHRIL_NETWORK\".\"mithril-networks\"[] | keys[]" "$JSON_FILE" | while read -r MITHRIL_NETWORK_NAME; do
38+
row="| $MITHRIL_NETWORK_NAME"
39+
40+
# For each cardano-minimum-version key, get the value
41+
for MITHRIL_NODE in $MITHRIL_NODES; do
42+
version=$(jq -r ".\"$MITHRIL_NETWORK\".\"cardano-minimum-version\".\"$MITHRIL_NODE\" // \"N/A\"" "$JSON_FILE")
43+
if [[ "$version" != "N/A" ]]; then
44+
row="$row | Cardano \`$version+\`<sup>(*)</sup>"
45+
else
46+
row="$row | N/A"
47+
fi
48+
done
49+
50+
row="$row |"
51+
echo "$row"
52+
done
53+
done
54+
55+
echo ""
56+
echo "<sup>*</sup>: Up to the latest Cardano node version released at the time of this release."

networks.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"mainnet": {
33
"cardano-minimum-version": {
4-
"mithril-signer": "10.4.1"
4+
"mithril-signer": "10.4.1",
5+
"mithril-aggregator": "10.4.1"
56
},
67
"mithril-networks": [
78
{
@@ -36,7 +37,8 @@
3637
},
3738
"preprod": {
3839
"cardano-minimum-version": {
39-
"mithril-signer": "10.4.1"
40+
"mithril-signer": "10.4.1",
41+
"mithril-aggregator": "10.4.1"
4042
},
4143
"mithril-networks": [
4244
{
@@ -71,7 +73,8 @@
7173
},
7274
"preview": {
7375
"cardano-minimum-version": {
74-
"mithril-signer": "10.4.1"
76+
"mithril-signer": "10.4.1",
77+
"mithril-aggregator": "10.4.1"
7578
},
7679
"mithril-networks": [
7780
{

0 commit comments

Comments
 (0)