File tree 3 files changed +7
-42
lines changed
3 files changed +7
-42
lines changed Original file line number Diff line number Diff line change @@ -29,22 +29,10 @@ inputs:
29
29
runs :
30
30
using : composite
31
31
steps :
32
- - name : Get Go Version
33
- shell : bash
34
- id : go-version
35
- run : |
36
- version=$(sed -ne '/^toolchain /s/^toolchain go//p' ${{ inputs.go-version-file }})
37
- if [ -z "$version" ]; then
38
- version=$(sed -ne '/^go /s/^go //p' ${{ inputs.go-version-file }})
39
- echo "Toolchain version not found in ${{ inputs.go-version-file }}, using go directive instead."
40
- fi
41
- echo "Go Version: $version"
42
- echo "version=$version" >> "$GITHUB_OUTPUT"
43
-
44
32
- name : Set up Go
45
33
uses : actions/setup-go@v5
46
34
with :
47
- go-version : ${{ steps .go-version.outputs.version }}
35
+ go-version-file : ${{ inputs .go-version-file }}
48
36
cache : false
49
37
check-latest : true
50
38
Original file line number Diff line number Diff line change 9
9
"go/token"
10
10
"os"
11
11
"os/exec"
12
- "path/filepath"
13
12
"regexp"
14
13
"strings"
15
14
@@ -40,8 +39,7 @@ type AbigenArgs struct {
40
39
// Check whether native abigen is installed, and has correct version
41
40
func Abigen (a AbigenArgs ) {
42
41
var versionResponse bytes.Buffer
43
- abigenExecutablePath := filepath .Join (GetProjectRoot (), "tools/bin/abigen" )
44
- abigenVersionCheck := exec .Command (abigenExecutablePath , "--version" )
42
+ abigenVersionCheck := exec .Command ("abigen" , "--version" )
45
43
abigenVersionCheck .Stdout = & versionResponse
46
44
if err := abigenVersionCheck .Run (); err != nil {
47
45
Exit ("no native abigen; you must install it (`make abigen` in the " +
@@ -64,7 +62,7 @@ func Abigen(a AbigenArgs) {
64
62
if a .Bin != "-" {
65
63
args = append (args , "-bin" , a .Bin )
66
64
}
67
- buildCommand := exec .Command (abigenExecutablePath , args ... )
65
+ buildCommand := exec .Command ("abigen" , args ... )
68
66
var buildResponse bytes.Buffer
69
67
buildCommand .Stderr = & buildResponse
70
68
if err := buildCommand .Run (); err != nil {
Original file line number Diff line number Diff line change 3
3
# Checks that the correct abigen is installed in this directory, and installs it
4
4
# if not.
5
5
6
- set -e
6
+ set -euo pipefail
7
7
8
8
# Version of abigen to install. Must be run within chainlink project
9
9
GETH_VERSION=$( go list -json -m github.com/ethereum/go-ethereum | jq -r .Version)
10
- GETH_REPO_URL=" https://github.com/ethereum/go-ethereum"
11
-
12
- function realpath { echo $( cd $( dirname $1 ) ; pwd) /$( basename $1 ) ; }
13
- THIS_DIR=" $( realpath " $( dirname $0 ) " ) "
14
10
15
11
NATIVE_ABIGEN_VERSION=v" $(
16
- " $THIS_DIR / abigen" --version 2> /dev/null | \
17
- grep -E -o ' ([0-9]+\.[0-9]+\.[0-9]+)'
12
+ abigen --version 2> /dev/null |
13
+ grep -E -o ' ([0-9]+\.[0-9]+\.[0-9]+)'
18
14
) " || true
19
15
20
16
if [ " $NATIVE_ABIGEN_VERSION " == " $GETH_VERSION " ]; then
21
17
echo " Correct abigen version already installed."
22
18
exit 0
23
19
fi
24
20
25
- function cleanup() {
26
- rm -rf " $TMPDIR "
27
- }
28
-
29
- trap cleanup EXIT
30
-
31
- TMPDIR=" $( mktemp -d) "
32
-
33
- pushd " $TMPDIR "
34
-
35
- git clone --depth=1 --single-branch --branch " $GETH_VERSION " " $GETH_REPO_URL "
36
- cd go-ethereum/cmd/abigen
37
- go build
38
- rm -f " $THIS_DIR /abigen" # necessary on MacOS for code signing
39
- cp ./abigen " $THIS_DIR "
40
-
41
- popd
42
-
21
+ go install github.com/ethereum/go-ethereum/cmd/abigen@$GETH_VERSION
You can’t perform that action at this time.
0 commit comments