Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/actions/prepare-distribution/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ runs:
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)` |"' \
>> ./release-notes-addon.txt

- name: Add compatibility table
- name: Add network compatibility table
shell: bash
run: |
cat >> ./release-notes-addon.txt << EOF
Expand All @@ -108,6 +108,12 @@ runs:
| jq -r 'keys_unsorted[] as $network | "| \($network) | \(.[$network]) |"' \
>> ./release-notes-addon.txt

- name: Add Cardano node compatibility table
shell: bash
run: |
./.github/workflows/scripts/compute-cardano-compatibility.sh ./networks.json \
>> ./release-notes-addon.txt

- name: Add platform support table
shell: bash
run: |
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/scripts/compute-cardano-compatibility.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

set -e

JSON_FILE=$1

if [[ ! -f "$JSON_FILE" ]]; then
echo "Error: $JSON_FILE not found!"
exit 1
fi

# Get all unique keys from 'cardano-minimum-version'
MITHRIL_NODES=$(jq -r '[.[] | .["cardano-minimum-version"] | keys[]] | unique | .[]' "$JSON_FILE")

# Create header of the markdown table
header="| Network"
separator="|----------"

for key in $MITHRIL_NODES; do
title=$(echo "$key" | sed 's/-/ /g' | sed 's/\b\w/\U&/g')
header="$header | $title"
separator="$separator |:-------------:"
done

header="$header |"
separator="$separator |"

echo ""
echo "## Cardano Node Compatibility"
echo ""
echo "$header"
echo "$separator"

# Process each top-level network (mainnet, preprod, preview)
for MITHRIL_NETWORK in $(jq -r 'keys[]' "$JSON_FILE"); do
# Get all mithril-networks for this top-level network
jq -r ".\"$MITHRIL_NETWORK\".\"mithril-networks\"[] | keys[]" "$JSON_FILE" | while read -r MITHRIL_NETWORK_NAME; do
row="| $MITHRIL_NETWORK_NAME"

# For each cardano-minimum-version key, get the value
for MITHRIL_NODE in $MITHRIL_NODES; do
version=$(jq -r ".\"$MITHRIL_NETWORK\".\"cardano-minimum-version\".\"$MITHRIL_NODE\" // \"N/A\"" "$JSON_FILE")
if [[ "$version" != "N/A" ]]; then
row="$row | Cardano \`$version+\`<sup>(*)</sup>"
else
row="$row | N/A"
fi
done

row="$row |"
echo "$row"
done
done

echo ""
echo "<sup>*</sup>: Up to the latest Cardano node version released at the time of this release."
9 changes: 6 additions & 3 deletions networks.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"mainnet": {
"cardano-minimum-version": {
"mithril-signer": "10.4.1"
"mithril-signer": "10.4.1",
"mithril-aggregator": "10.4.1"
},
"mithril-networks": [
{
Expand Down Expand Up @@ -36,7 +37,8 @@
},
"preprod": {
"cardano-minimum-version": {
"mithril-signer": "10.4.1"
"mithril-signer": "10.4.1",
"mithril-aggregator": "10.4.1"
},
"mithril-networks": [
{
Expand Down Expand Up @@ -71,7 +73,8 @@
},
"preview": {
"cardano-minimum-version": {
"mithril-signer": "10.4.1"
"mithril-signer": "10.4.1",
"mithril-aggregator": "10.4.1"
},
"mithril-networks": [
{
Expand Down
Loading