plugeth/.circleci/config.yml

109 lines
3.7 KiB
YAML
Raw Normal View History

2022-01-11 20:40:43 +00:00
orbs:
aws-cli: circleci/aws-cli@1.0.0 #See: https://circleci.com/orbs/registry/orb/circleci/aws-cli
version: 2.1
jobs:
test:
docker:
2024-01-05 17:27:27 +00:00
- image: cimg/go:1.21.0
steps:
- checkout
2021-10-18 19:49:48 +00:00
- run:
name: Prep env
command: |
mkdir -p /home/circleci/go/src
mkdir artifacts
go mod tidy
- run:
name: test rpc
command: go test ./rpc/
- run:
name: test eth
command: go test ./eth/
- run:
name: test eth/tracers
command: go test ./eth/tracers/
- run:
name: test core
command: go test ./core/
- run:
name: test core/vm
command: go test ./core/vm/
- run:
name: test core/state
command: go test ./core/state/
- run:
name: test core/rawdb
command: go test ./core/rawdb/
build_geth_push:
docker: # run the steps with Docker
2024-01-05 17:27:27 +00:00
- image: cimg/go:1.21.0 # ...with this image as the primary container
# this is where all `steps` will run
steps:
- checkout
- setup_remote_docker
- run:
name: Prep env
command: |
mkdir -p /home/circleci/go/src
mkdir artifacts
2021-10-18 19:49:48 +00:00
go mod tidy
- run:
name: build geth binaries
command: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu libc6-dev-arm64-cross wget -y
PLUGETH_UTILS_VERSION=$(grep "github.com/openrelayxyz/plugeth-utils v" go.mod | cut -d ' ' -f 2)
export GOPATH=$HOME/go
export GOARCH=amd64
export PLUGETH_UTILS_VERSION=$(grep "github.com/openrelayxyz/plugeth-utils v" go.mod | cut -d ' ' -f 2)
go build -o ./artifacts/geth-linux-amd64-$PLUGETH_UTILS_VERSION-${CIRCLE_TAG} ./cmd/geth
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=arm64 go build -o ./artifacts/geth-linux-arm64-$PLUGETH_UTILS_VERSION-${CIRCLE_TAG} ./cmd/geth
- run:
name: "Publish Release on GitHub"
command: |
go install github.com/tcnksm/ghr@v0.14.0
PLUGETH_UTILS_VERSION=$(grep "github.com/openrelayxyz/plugeth-utils v" go.mod | cut -d ' ' -f 2)
NAME=plugeth-$PLUGETH_UTILS_VERSION-${CIRCLE_TAG}
VERSION=${CIRCLE_TAG}
ghr -draft -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -name $NAME -delete ${VERSION} ./artifacts/
2022-01-11 20:40:43 +00:00
- aws-cli/setup: #See: https://circleci.com/orbs/registry/orb/circleci/aws-cli
aws-access-key-id: ACCESS_KEY
aws-secret-access-key: SECRET_ACCESS_KEY
aws-region: AWS_REGION
- run:
name: push to s3
command: |
export PLUGETH_UTILS_VERSION=$(grep "github.com/openrelayxyz/plugeth-utils v" go.mod | cut -d ' ' -f 2)
aws s3 cp ./artifacts/geth-linux-amd64-$PLUGETH_UTILS_VERSION-${CIRCLE_TAG} s3://ethercattle-binaries/plugeth/$CIRCLE_TAG/geth-linux-amd64 --acl=public-read
aws s3 cp ./artifacts/geth-linux-arm64-$PLUGETH_UTILS_VERSION-${CIRCLE_TAG} s3://ethercattle-binaries/plugeth/$CIRCLE_TAG/geth-linux-arm64 --acl=public-read
- run:
name: Message Slack
command: |
./slack-post.sh -w $SLACK_WEBHOOK -m "*plugeth*:\nTag: $CIRCLE_TAG \n"
workflows:
version: 2
2021-10-18 19:49:48 +00:00
test:
jobs:
- test:
filters:
tags:
ignore: /^v.*/
build_and_test:
jobs:
2021-10-18 19:49:48 +00:00
- test:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
2021-10-18 19:49:48 +00:00
- build_geth_push:
2022-01-11 20:40:43 +00:00
context: Rivet
2021-10-18 19:49:48 +00:00
requires:
- test
2021-10-22 19:37:11 +00:00
filters:
tags:
only: /^v.*/