Skip to content

Commit

Permalink
Merge pull request #108 from ava-labs/gstuart/set-go-version-workflows
Browse files Browse the repository at this point in the history
Set go version properly in workflows
  • Loading branch information
geoff-vball authored Dec 12, 2023
2 parents 463e4bb + 8f05904 commit f974e62
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,26 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Checkout subnet-evm repository
- name: Checkout awm-relayer repository
uses: actions/checkout@v4
with:
repository: ava-labs/subnet-evm
ref: v0.5.8


- name: Set Go version
run: |
source ./scripts/versions.sh
GO_VERSION=$GO_VERSION >> $GITHUB_ENV
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
echo SUBNET_EVM_VERSION=$SUBNET_EVM_VERSION >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout subnet-evm repository
uses: actions/checkout@v4
with:
repository: ava-labs/subnet-evm
ref: v0.5.8 # TODO set with env.SUBNET_EVM_VERSION

- name: Install AvalancheGo Release
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set Go version
run: |
source ./scripts/versions.sh
GO_VERSION=$GO_VERSION >> $GITHUB_ENV
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set Go version
run: |
source ./scripts/versions.sh
GO_VERSION=$GO_VERSION >> $GITHUB_ENV
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
- name: Build and Push to Docker Hub
uses: docker/build-push-action@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set Go version
run: |
source ./scripts/versions.sh
GO_VERSION=$GO_VERSION >> $GITHUB_ENV
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Setup

To start developing on AWM Relayer, you'll need Golang >= v1.18.1.
To start developing on AWM Relayer, you'll need Golang >= v1.20.12.

## Issues

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ava-labs/awm-relayer

go 1.18
go 1.20

require (
github.com/ava-labs/avalanchego v1.10.15
Expand Down
14 changes: 7 additions & 7 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ set -o errexit
set -o nounset
set -o pipefail

go_version_minimum="1.18.1"

go_version() {
go version | sed -nE -e 's/[^0-9.]+([0-9.]+).+/\1/p'
}
Expand All @@ -24,11 +22,6 @@ version_lt() {
fi
}

if version_lt "$(go_version)" "$go_version_minimum"; then
echo "awm-relayer requires Go >= $go_version_minimum, Go $(go_version) found." >&2
exit 1
fi

# Root directory
RELAYER_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
Expand All @@ -39,6 +32,13 @@ RELAYER_PATH=$(
source "$RELAYER_PATH"/scripts/versions.sh
source "$RELAYER_PATH"/scripts/constants.sh

go_version_minimum=$GO_VERSION

if version_lt "$(go_version)" "$go_version_minimum"; then
echo "awm-relayer requires Go >= $go_version_minimum, Go $(go_version) found." >&2
exit 1
fi

if [[ $# -eq 1 ]]; then
binary_path=$1
elif [[ $# -eq 0 ]]; then
Expand Down

0 comments on commit f974e62

Please sign in to comment.