Skip to content

Commit c1c967a

Browse files
author
Francisco de Borja Aranda Castillejo
authored
ci: fix abigen version (zeta-chain#2850)
1 parent 38dd989 commit c1c967a

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

scripts/bindings-stateful-precompiles.sh

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,65 @@
11
#!/usr/bin/env bash
2+
# set -x
3+
4+
ABIGEN_VERSION=1.14.8-stable
5+
ABIGEN_VERSION_SOURCE=github.com/ethereum/go-ethereum/cmd/[email protected]
6+
ABIGEN_INSTALL_CMD="go install $(echo $ABIGEN_VERSION_SOURCE)"
7+
8+
SOLC_VERSION=0.8.26
9+
SOLC_SELECT_CMD_INSTALL="solc-select install $(echo $SOLC_VERSION)"
10+
SOLC_SELECT_CMD_USE="solc-select use $(echo $SOLC_VERSION)"
11+
12+
install_abigen() {
13+
echo "Installing abigen version $ABIGEN_VERSION..."
14+
$ABIGEN_INSTALL_CMD
15+
if [ $? -ne 0 ]; then
16+
echo "Error: Failed to install abigen."
17+
exit 1
18+
fi
19+
echo "abigen version $ABIGEN_VERSION installed successfully."
20+
}
221

322
# Check if abigen is installed
4-
if ! command -v abigen &> /dev/null
5-
then
6-
echo "abigen could not be found, installing..."
7-
go install github.com/ethereum/go-ethereum/cmd/abigen@latest
23+
if command -v abigen &> /dev/null; then
24+
INSTALLED_ABIGEN_VERSION=$(abigen --version | grep -o "$ABIGEN_VERSION")
25+
if [ "$INSTALLED_ABIGEN_VERSION" == "$ABIGEN_VERSION" ]; then
26+
echo "abigen version $ABIGEN_VERSION is already installed."
27+
else
28+
echo "abigen version $ABIGEN_VERSION not found, installing..."
29+
install_abigen
30+
fi
31+
else
32+
echo "abigen not found, installing..."
33+
install_abigen
834
fi
935

1036
# Check if solc is installed and at version 0.8.26
1137
if command -v solc &> /dev/null
1238
then
13-
SOLC_VERSION=$(solc --version | grep -o "Version: 0.8.26")
14-
if [ "$SOLC_VERSION" == "Version: 0.8.26" ]; then
15-
echo "solc version 0.8.26 is already installed."
39+
INSTALLED_SOLC_VERSION=$(solc --version | grep -o "$SOLC_VERSION")
40+
if [ "$INSTALLED_SOLC_VERSION" == "$SOLC_VERSION" ]; then
41+
echo "solc version $SOLC_VERSION is already installed."
1642
else
17-
echo "solc is installed but not version 0.8.26. Checking for solc-select..."
43+
echo "solc is installed but not version $SOLC_VERSION. Checking for solc-select..."
1844
if command -v solc-select &> /dev/null
1945
then
20-
echo "solc-select found, installing and using solc 0.8.26..."
21-
solc-select install 0.8.26
22-
solc-select use 0.8.26
46+
echo "solc-select found, installing and using solc $SOLC_VERSION."
47+
$SOLC_SELECT_CMD_INSTALL
48+
$SOLC_SELECT_CMD_USE
2349
else
24-
echo "solc-select not found. Please install solc-select or ensure solc 0.8.26 is available."
50+
echo "solc-select not found. Please install solc-select or ensure solc $SOLC_VERSION is available."
2551
exit 1
2652
fi
2753
fi
2854
else
2955
echo "solc is not installed. Checking for solc-select..."
3056
if command -v solc-select &> /dev/null
3157
then
32-
echo "solc-select found, installing and using solc 0.8.26..."
33-
solc-select install 0.8.26
34-
solc-select use 0.8.26
58+
echo "solc-select found, installing and using solc $SOLC_VERSION."
59+
$SOLC_SELECT_CMD_INSTALL
60+
$SOLC_SELECT_CMD_USE
3561
else
36-
echo "solc or solc-select could not be found. Please install one of them to proceed."
62+
echo "solc-select not found. Please install solc-select or ensure solc $SOLC_VERSION is available."
3763
exit 1
3864
fi
3965
fi

0 commit comments

Comments
 (0)