Skip to content

Commit b6f87ee

Browse files
authored
ci: fix build (#62)
* Align Go's prepare.sh to upstream * check for lt, and error if true (must be >=), update all go servlets Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
1 parent 31bf246 commit b6f87ee

File tree

14 files changed

+315
-139
lines changed

14 files changed

+315
-139
lines changed

servlets/amadeus-flight-api/prepare.sh

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/bin/bash
2+
set -eou pipefail
23

34
# Function to check if a command exists
45
command_exists () {
56
command -v "$1" >/dev/null 2>&1
67
}
78

9+
# Function to compare version numbers for "less than"
10+
version_lt() {
11+
test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1" && test "$1" != "$2"
12+
}
13+
814
missing_deps=0
915

1016
# Check for Go
1117
if ! (command_exists go); then
1218
missing_deps=1
13-
echo "❌ Go (supported version between 1.18 - 1.22) is not installed."
19+
echo "❌ Go (supported version between 1.20 - 1.24) is not installed."
1420
echo ""
1521
echo "To install Go, visit the official download page:"
1622
echo "👉 https://go.dev/dl/"
@@ -26,27 +32,29 @@ if ! (command_exists go); then
2632
echo "🔹 Arch Linux:"
2733
echo " sudo pacman -S go"
2834
echo ""
35+
echo "🔹 Windows:"
36+
echo " scoop install go"
37+
echo ""
2938
fi
3039

31-
# Check for the right version of Go, needed by TinyGo (supports go 1.18 - 1.22)
40+
# Check for the right version of Go, needed by TinyGo (supports go 1.20 - 1.24)
3241
if (command_exists go); then
3342
compat=0
34-
for v in `seq 18 22`; do
43+
for v in `seq 20 24`; do
3544
if (go version | grep -q "go1.$v"); then
3645
compat=1
3746
fi
3847
done
3948

4049
if [ $compat -eq 0 ]; then
41-
echo "❌ Supported Go version is not installed. Must be Go 1.18 - 1.22."
50+
echo "❌ Supported Go version is not installed. Must be Go 1.20 - 1.24."
4251
echo ""
4352
fi
4453
fi
4554

46-
4755
ARCH=$(arch)
4856

49-
# Check for TinyGo
57+
# Check for TinyGo and its version
5058
if ! (command_exists tinygo); then
5159
missing_deps=1
5260
echo "❌ TinyGo is not installed."
@@ -61,12 +69,24 @@ if ! (command_exists tinygo); then
6169
echo " brew install tinygo"
6270
echo ""
6371
echo "🔹 Ubuntu/Debian:"
64-
echo " wget https://github.com/tinygo-org/tinygo/releases/download/v0.31.2/tinygo_0.31.2_$ARCH.deb"
65-
echo " sudo dpkg -i tinygo_0.31.2_$ARCH.deb"
72+
echo " wget https://github.com/tinygo-org/tinygo/releases/download/v0.34.0/tinygo_0.34.0_$ARCH.deb"
73+
echo " sudo dpkg -i tinygo_0.34.0_$ARCH.deb"
6674
echo ""
6775
echo "🔹 Arch Linux:"
6876
echo " pacman -S extra/tinygo"
6977
echo ""
78+
echo "🔹 Windows:"
79+
echo " scoop install tinygo"
80+
echo ""
81+
else
82+
# Check TinyGo version
83+
tinygo_version=$(tinygo version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n1)
84+
if version_lt "$tinygo_version" "0.34.0"; then
85+
missing_deps=1
86+
echo "❌ TinyGo version must be >= 0.34.0 (current version: $tinygo_version)"
87+
echo "Please update TinyGo to a newer version."
88+
echo ""
89+
fi
7090
fi
7191

7292
go install golang.org/x/tools/cmd/goimports@latest

servlets/assembly-ai/prepare.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ command_exists () {
66
command -v "$1" >/dev/null 2>&1
77
}
88

9-
# Function to compare version numbers
10-
version_gt() {
11-
test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"
9+
# Function to compare version numbers for "less than"
10+
version_lt() {
11+
test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1" && test "$1" != "$2"
1212
}
1313

1414
missing_deps=0
1515

1616
# Check for Go
1717
if ! (command_exists go); then
1818
missing_deps=1
19-
echo "❌ Go (supported version between 1.18 - 1.23) is not installed."
19+
echo "❌ Go (supported version between 1.20 - 1.24) is not installed."
2020
echo ""
2121
echo "To install Go, visit the official download page:"
2222
echo "👉 https://go.dev/dl/"
@@ -37,17 +37,17 @@ if ! (command_exists go); then
3737
echo ""
3838
fi
3939

40-
# Check for the right version of Go, needed by TinyGo (supports go 1.18 - 1.23)
40+
# Check for the right version of Go, needed by TinyGo (supports go 1.20 - 1.24)
4141
if (command_exists go); then
4242
compat=0
43-
for v in `seq 18 23`; do
43+
for v in `seq 20 24`; do
4444
if (go version | grep -q "go1.$v"); then
4545
compat=1
4646
fi
4747
done
4848

4949
if [ $compat -eq 0 ]; then
50-
echo "❌ Supported Go version is not installed. Must be Go 1.18 - 1.23."
50+
echo "❌ Supported Go version is not installed. Must be Go 1.20 - 1.24."
5151
echo ""
5252
fi
5353
fi
@@ -81,12 +81,12 @@ if ! (command_exists tinygo); then
8181
else
8282
# Check TinyGo version
8383
tinygo_version=$(tinygo version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n1)
84-
if ! version_gt "$tinygo_version" "0.34.0"; then
84+
if version_lt "$tinygo_version" "0.34.0"; then
8585
missing_deps=1
86-
echo "❌ TinyGo version must be greater than 0.34.0 (current version: $tinygo_version)"
86+
echo "❌ TinyGo version must be >= 0.34.0 (current version: $tinygo_version)"
8787
echo "Please update TinyGo to a newer version."
8888
echo ""
8989
fi
9090
fi
9191

92-
go install golang.org/x/tools/cmd/goimports@latest
92+
go install golang.org/x/tools/cmd/goimports@latest

servlets/bluesky/prepare.sh

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/bin/bash
2+
set -eou pipefail
23

34
# Function to check if a command exists
45
command_exists () {
56
command -v "$1" >/dev/null 2>&1
67
}
78

9+
# Function to compare version numbers for "less than"
10+
version_lt() {
11+
test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1" && test "$1" != "$2"
12+
}
13+
814
missing_deps=0
915

1016
# Check for Go
1117
if ! (command_exists go); then
1218
missing_deps=1
13-
echo "❌ Go (supported version between 1.18 - 1.22) is not installed."
19+
echo "❌ Go (supported version between 1.20 - 1.24) is not installed."
1420
echo ""
1521
echo "To install Go, visit the official download page:"
1622
echo "👉 https://go.dev/dl/"
@@ -26,27 +32,29 @@ if ! (command_exists go); then
2632
echo "🔹 Arch Linux:"
2733
echo " sudo pacman -S go"
2834
echo ""
35+
echo "🔹 Windows:"
36+
echo " scoop install go"
37+
echo ""
2938
fi
3039

31-
# Check for the right version of Go, needed by TinyGo (supports go 1.18 - 1.22)
40+
# Check for the right version of Go, needed by TinyGo (supports go 1.20 - 1.24)
3241
if (command_exists go); then
3342
compat=0
34-
for v in `seq 18 22`; do
43+
for v in `seq 20 24`; do
3544
if (go version | grep -q "go1.$v"); then
3645
compat=1
3746
fi
3847
done
3948

4049
if [ $compat -eq 0 ]; then
41-
echo "❌ Supported Go version is not installed. Must be Go 1.18 - 1.22."
50+
echo "❌ Supported Go version is not installed. Must be Go 1.20 - 1.24."
4251
echo ""
4352
fi
4453
fi
4554

46-
4755
ARCH=$(arch)
4856

49-
# Check for TinyGo
57+
# Check for TinyGo and its version
5058
if ! (command_exists tinygo); then
5159
missing_deps=1
5260
echo "❌ TinyGo is not installed."
@@ -61,12 +69,24 @@ if ! (command_exists tinygo); then
6169
echo " brew install tinygo"
6270
echo ""
6371
echo "🔹 Ubuntu/Debian:"
64-
echo " wget https://github.com/tinygo-org/tinygo/releases/download/v0.31.2/tinygo_0.31.2_$ARCH.deb"
65-
echo " sudo dpkg -i tinygo_0.31.2_$ARCH.deb"
72+
echo " wget https://github.com/tinygo-org/tinygo/releases/download/v0.34.0/tinygo_0.34.0_$ARCH.deb"
73+
echo " sudo dpkg -i tinygo_0.34.0_$ARCH.deb"
6674
echo ""
6775
echo "🔹 Arch Linux:"
6876
echo " pacman -S extra/tinygo"
6977
echo ""
78+
echo "🔹 Windows:"
79+
echo " scoop install tinygo"
80+
echo ""
81+
else
82+
# Check TinyGo version
83+
tinygo_version=$(tinygo version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n1)
84+
if version_lt "$tinygo_version" "0.34.0"; then
85+
missing_deps=1
86+
echo "❌ TinyGo version must be >= 0.34.0 (current version: $tinygo_version)"
87+
echo "Please update TinyGo to a newer version."
88+
echo ""
89+
fi
7090
fi
7191

7292
go install golang.org/x/tools/cmd/goimports@latest

servlets/brave-search/prepare.sh

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/bin/bash
2+
set -eou pipefail
23

34
# Function to check if a command exists
45
command_exists () {
56
command -v "$1" >/dev/null 2>&1
67
}
78

9+
# Function to compare version numbers for "less than"
10+
version_lt() {
11+
test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1" && test "$1" != "$2"
12+
}
13+
814
missing_deps=0
915

1016
# Check for Go
1117
if ! (command_exists go); then
1218
missing_deps=1
13-
echo "❌ Go (supported version between 1.18 - 1.22) is not installed."
19+
echo "❌ Go (supported version between 1.20 - 1.24) is not installed."
1420
echo ""
1521
echo "To install Go, visit the official download page:"
1622
echo "👉 https://go.dev/dl/"
@@ -26,27 +32,29 @@ if ! (command_exists go); then
2632
echo "🔹 Arch Linux:"
2733
echo " sudo pacman -S go"
2834
echo ""
35+
echo "🔹 Windows:"
36+
echo " scoop install go"
37+
echo ""
2938
fi
3039

31-
# Check for the right version of Go, needed by TinyGo (supports go 1.18 - 1.22)
40+
# Check for the right version of Go, needed by TinyGo (supports go 1.20 - 1.24)
3241
if (command_exists go); then
3342
compat=0
34-
for v in `seq 18 22`; do
43+
for v in `seq 20 24`; do
3544
if (go version | grep -q "go1.$v"); then
3645
compat=1
3746
fi
3847
done
3948

4049
if [ $compat -eq 0 ]; then
41-
echo "❌ Supported Go version is not installed. Must be Go 1.18 - 1.22."
50+
echo "❌ Supported Go version is not installed. Must be Go 1.20 - 1.24."
4251
echo ""
4352
fi
4453
fi
4554

46-
4755
ARCH=$(arch)
4856

49-
# Check for TinyGo
57+
# Check for TinyGo and its version
5058
if ! (command_exists tinygo); then
5159
missing_deps=1
5260
echo "❌ TinyGo is not installed."
@@ -61,12 +69,24 @@ if ! (command_exists tinygo); then
6169
echo " brew install tinygo"
6270
echo ""
6371
echo "🔹 Ubuntu/Debian:"
64-
echo " wget https://github.com/tinygo-org/tinygo/releases/download/v0.31.2/tinygo_0.31.2_$ARCH.deb"
65-
echo " sudo dpkg -i tinygo_0.31.2_$ARCH.deb"
72+
echo " wget https://github.com/tinygo-org/tinygo/releases/download/v0.34.0/tinygo_0.34.0_$ARCH.deb"
73+
echo " sudo dpkg -i tinygo_0.34.0_$ARCH.deb"
6674
echo ""
6775
echo "🔹 Arch Linux:"
6876
echo " pacman -S extra/tinygo"
6977
echo ""
78+
echo "🔹 Windows:"
79+
echo " scoop install tinygo"
80+
echo ""
81+
else
82+
# Check TinyGo version
83+
tinygo_version=$(tinygo version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n1)
84+
if version_lt "$tinygo_version" "0.34.0"; then
85+
missing_deps=1
86+
echo "❌ TinyGo version must be >= 0.34.0 (current version: $tinygo_version)"
87+
echo "Please update TinyGo to a newer version."
88+
echo ""
89+
fi
7090
fi
7191

7292
go install golang.org/x/tools/cmd/goimports@latest

0 commit comments

Comments
 (0)