Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e6c9e62
Remove specified git version to avoid downgrades breaking docker build
aaronbuchwald Mar 3, 2023
b3e2018
Add build docker image to unit test action
aaronbuchwald Mar 3, 2023
5e1a35d
Update to use current branch instead of commit for docker image build
aaronbuchwald Mar 3, 2023
c155835
Update docker image script to push image if env var is set
aaronbuchwald Mar 5, 2023
a107c34
Add new line to build image script
aaronbuchwald Mar 5, 2023
6c53531
Update scripts/constants.sh
aaronbuchwald Mar 6, 2023
5183567
Merge branch 'master' into fix-dockerfile
aaronbuchwald Mar 7, 2023
006c139
Update docker login
aaronbuchwald Mar 7, 2023
99c62e3
Merge branch 'master' into fix-dockerfile
aaronbuchwald Mar 7, 2023
1eb57cb
Merge branch 'master' into fix-dockerfile
aaronbuchwald Mar 7, 2023
41d32c3
Update build image action
aaronbuchwald Mar 7, 2023
649d08f
Update gh action
aaronbuchwald Mar 8, 2023
8231fa1
checkout for docker image build
aaronbuchwald Mar 8, 2023
98e4221
Set build image ID in gh action with github.ref_name
aaronbuchwald Mar 8, 2023
7f6cade
Separate CI and release
aaronbuchwald Mar 8, 2023
5423ab4
remove extra copy
aaronbuchwald Mar 8, 2023
edf164c
Update name
aaronbuchwald Mar 8, 2023
37d2c88
Update variable used in build image id
aaronbuchwald Mar 8, 2023
caf21d0
Update set var
aaronbuchwald Mar 8, 2023
bf94a7c
Update dockerhub repo
aaronbuchwald Mar 8, 2023
e2d7a2d
Merge branch 'master' into fix-dockerfile
aaronbuchwald Mar 8, 2023
3e3037c
Revert dockerhub repo name chnge and use Subnet-EVM in tag name
aaronbuchwald Mar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build + test + release
name: Build + Test + Lint

on:
push:
Expand Down Expand Up @@ -43,6 +43,16 @@ jobs:
- run: ./scripts/coverage.sh
shell: bash

build_image:
name: Build Docker Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: echo ${{ secrets.docker_pass }} | docker login --username ${{ secrets.docker_username }} --password-stdin
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses the same setup as AvalancheGo, ran into issues with the docker login GitHub action where I wasn't able to get it working: https://github.com/docker/login-action

shell: bash
- run: CURRENT_BRANCH=${{ github.head_ref || github.ref_name }} PUSH_DOCKER_IMAGE=true ./scripts/build_image.sh
shell: bash

e2e_test:
name: e2e tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -71,44 +81,3 @@ jobs:
- name: Run E2E Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh

release:
# needs: [lint_test, unit_test, e2e_test, simulator_test]
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
path: subnet-evm
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19"
- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Checkout osxcross
uses: actions/checkout@v2
with:
repository: tpoechtrager/osxcross
path: osxcross
- name: Build osxcross
run: |
sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
cd osxcross
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz
echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c -
UNATTENDED=1 ./build.sh
echo $PWD/target/bin >> $GITHUB_PATH
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
workdir: ./subnet-evm/
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
# needs: [lint_test, unit_test, e2e_test, simulator_test]
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
path: subnet-evm
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19"
- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Checkout osxcross
uses: actions/checkout@v2
with:
repository: tpoechtrager/osxcross
path: osxcross
- name: Build osxcross
run: |
sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
cd osxcross
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz
echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c -
UNATTENDED=1 ./build.sh
echo $PWD/target/bin >> $GITHUB_PATH
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
workdir: ./subnet-evm/
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG AVALANCHE_VERSION

# ============= Compilation Stage ================
FROM golang:1.19.6-buster AS builder
RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64
RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64

WORKDIR /build

Expand Down
4 changes: 4 additions & 0 deletions scripts/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ docker build -t "$DOCKERHUB_REPO:$BUILD_IMAGE_ID" "$SUBNET_EVM_PATH" -f "$SUBNET
--build-arg AVALANCHE_VERSION="$AVALANCHEGO_VERSION" \
--build-arg SUBNET_EVM_COMMIT="$SUBNET_EVM_COMMIT" \
--build-arg CURRENT_BRANCH="$CURRENT_BRANCH"

if [[ ${PUSH_DOCKER_IMAGE:-""} == "true" ]]; then
docker push $DOCKERHUB_REPO:$BUILD_IMAGE_ID
fi
2 changes: 1 addition & 1 deletion scripts/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

echo "Using branch: ${CURRENT_BRANCH}"

BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"$AVALANCHEGO_VERSION-$SUBNET_EVM_COMMIT_ID"}
BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"${AVALANCHEGO_VERSION}-Subnet-EVM-${CURRENT_BRANCH}"}

# Static compilation
STATIC_LD_FLAGS=''
Expand Down