forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GHA workflow to build binary and push image to ECR (ethereum#55, e…
- Loading branch information
1 parent
99e956f
commit 7e30c24
Showing
3 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: build artifacts on every new commit | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- '!main' | ||
- '**omnibus**' | ||
paths-ignore: | ||
- '.github/**' | ||
- 'patches/**' | ||
- README.md | ||
- Makefile | ||
- update-patch.go | ||
- .gitignore | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-20.04 | ||
env: | ||
GOPRIVATE: github.com/INFURA | ||
steps: | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v1 | ||
with: | ||
# keep this version in sync w/ build step below and .tool-versions file | ||
go-version: 1.21.6 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: run tests | ||
run: | | ||
go test ./eth ./rpc ./core ./internal/ethapi | ||
build: | ||
name: Build Artifacts | ||
runs-on: ubuntu-20.04 | ||
env: | ||
GOPRIVATE: github.com/INFURA | ||
outputs: | ||
geth-version: ${{ steps.output-version.outputs.geth-version }} | ||
steps: | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v1 | ||
with: | ||
# keep this version in sync w/ test step above and .tool-versions file | ||
go-version: 1.21.6 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: build artifacts | ||
run: | | ||
make geth | ||
cp ./build/bin/geth ./geth-linux-amd64 | ||
- name: Output Geth version | ||
id: output-version | ||
run: | | ||
export GETH_VERSION=$(./geth-linux-amd64 version | grep -e "^Version" | cut -f 2 -d' ')-$(./geth-linux-amd64 version | grep -e "^Git" | cut -f 3 -d' ' | cut -c 1-8) | ||
echo "geth-version=${GETH_VERSION}" >> $GITHUB_OUTPUT | ||
echo "### Built Omnibus Version" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "\`${GETH_VERSION}\`" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
- name: upload artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: geth-linux-amd64 | ||
path: ./geth-linux-amd64 | ||
|
||
push_docker_image: | ||
name: Build and push Omnibus Docker image to ECR | ||
uses: consensys/github-toolkit/.github/workflows/ecr-login-push.yml@v2 | ||
needs: build | ||
with: | ||
role_to_assume: ecr-read-write-infura-evm-omnibus | ||
aws_account_id: 580947410102 | ||
ecr_repo_name: infura/evm/omnibus | ||
push_to_ecr: true | ||
image_tag: ${{ needs.build.outputs.geth-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# keep golang version here in sync w/ versions in .github/workflows/push.yaml | ||
golang 1.21.6 |