Skip to content

Commit 4790f37

Browse files
committed
fix: update Canton formula to latest snapshot version and improve version validation in tests
1 parent ebaf71c commit 4790f37

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Formula/canton.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ class Canton < Formula
33
homepage "https://www.canton.network/"
44
license "Apache-2.0"
55

6-
url "https://github.com/digital-asset/daml/releases/download/v3.4.0-snapshot.20250710.0/canton-open-source-3.4.0-snapshot.20250707.16366.0.vf80131e0.tar.gz"
7-
sha256 "395d51792fbd1ac38e21754cf21a3cde094a149218707c00e0e0ab0a67aa3a8d"
8-
version "3.4.0-snapshot.20250707.16366.0.vf80131e0"
6+
url "https://github.com/digital-asset/daml/releases/download/v3.4.0-snapshot.20250723.0/canton-open-source-3.4.0-snapshot.20250715.16432.0.vcd4fe703.tar.gz"
7+
sha256 "04f33ccadd9651b4be8fbbbd0c33039795a8ee86e3e07d2d9955200bce4ce74a"
8+
version "3.4.0-snapshot.20250715.16432.0.vcd4fe703"
99

1010
# Java 11+ is required (recommend 17 for best compatibility)
1111
depends_on "openjdk@17" => :recommended
@@ -40,7 +40,7 @@ def caveats
4040

4141
# Test that Java is available (required for Canton to run)
4242
java_version = shell_output("java -version 2>&1")
43-
assert_match(/version "3.4.0-snapshot.20250707.16366.0.vf80131e0"/, java_version)
43+
assert_match(/version "[1-9][0-9]"/, java_version)
4444

4545
# Test that Canton can show help (basic functionality test)
4646
output = shell_output("#{bin}/canton --help 2>&1", 0)

update.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ else
1717
echo "Current version: $CURRENT_VERSION"
1818
fi
1919

20-
# Get top 5 releases from Digital Asset that contain Canton
20+
# Get top 5 releases from Digital Asset that contain Canton, prioritizing snapshots
2121
echo "Fetching top 5 Canton releases from Digital Asset..."
2222
ALL_RELEASES=$(curl -s "https://api.github.com/repos/digital-asset/daml/releases" | \
23-
jq -r '[.[] | select(.assets[] | select(.name | contains("canton-open-source") and endswith(".tar.gz")))] | .[0:5]')
23+
jq -r '[.[] | select(.assets[] | select(.name | contains("canton-open-source") and endswith(".tar.gz")))] | sort_by([.prerelease, .published_at]) | reverse | .[0:5]')
2424

2525
if [ "$ALL_RELEASES" = "null" ] || [ "$ALL_RELEASES" = "[]" ]; then
2626
echo "No Canton releases found"
@@ -84,9 +84,10 @@ while IFS= read -r release; do
8484
# Cleanup temp file
8585
rm -f "$TEMP_FILE"
8686

87-
# Update formula with this version (only for the first/latest version)
88-
if [ $PROCESSED_COUNT -eq 0 ]; then
89-
echo "Updating Formula/canton.rb with latest version..."
87+
# Update formula with the most recent pre-release if this is the first pre-release processed
88+
IS_PRERELEASE=$(echo "$release" | jq -r '.prerelease')
89+
if [ "$IS_PRERELEASE" = "true" ] && [ $PROCESSED_COUNT -eq 0 ]; then
90+
echo "Updating Formula/canton.rb with most recent pre-release: DAML $DAML_TAG (Canton $CANTON_VERSION)..."
9091
# Use different sed syntax for macOS vs Linux
9192
if [[ "$OSTYPE" == "darwin"* ]]; then
9293
# macOS

0 commit comments

Comments
 (0)