Skip to content

Commit

Permalink
Merge pull request #1 from gnosischain/update-upstream
Browse files Browse the repository at this point in the history
Update upstream
  • Loading branch information
giacomognosis authored Feb 1, 2024
2 parents dd1f42e + de819ec commit a6eb4e3
Show file tree
Hide file tree
Showing 16 changed files with 413 additions and 97 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/alpha-releases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: alpha releases

on:
push:
branches:
- 'release/*'

jobs:
tag-release:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
token: ${{ secrets.EPOBOT_TOKEN }}
- name: Get latest release version for this release branch
if: startsWith(github.ref, 'refs/heads/release/')
id: latest_version
run: |
# Extract suffix from branch name (e.g., 'dencun' from 'release/dencun')
RELEASE_SUFFIX=${GITHUB_REF#refs/heads/release/}
# Fetch all tags and get the latest that matches the pattern
# Using the refs/tags API
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/git/refs/tags" \
| jq -r --arg suffix "$RELEASE_SUFFIX" '.[] | select(.ref | test("refs/tags/v?[0-9]+\\.[0-9]+\\.[0-9]+-" + $suffix + "$")) | .ref' \
| sed 's|refs/tags/||' | sort -V | tail -n 1)
echo "Found latest $RELEASE_SUFFIX version: $LATEST_VERSION"
# Default to 0.0.0 if no matching release was found
if [[ -z "$LATEST_VERSION" ]]; then
LATEST_VERSION="0.0.0"
fi
# Increment the patch version using bash
LATEST_VERSION=$(echo "$LATEST_VERSION" | awk -F. -v OFS=. '{$NF = $NF + 1;} 1')
VERSION=$LATEST_VERSION-$RELEASE_SUFFIX
echo "Releasing version: $VERSION"
git config --global user.email "[email protected]"
git config --global user.name "ethpandaopsbot"
# Log the short commit SHA
SHORT_COMMIT=$(git rev-parse --short HEAD)
echo "Git commit: $SHORT_COMMIT"
git tag -a "$VERSION" -m "Release $VERSION"
echo "RELEASE_SUFFIX=$RELEASE_SUFFIX" >> $GITHUB_ENV
# Push the tag
git push origin "$VERSION"
env:
GITHUB_TOKEN: ${{ secrets.EPOBOT_TOKEN }}
65 changes: 58 additions & 7 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,84 @@ on:

jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
runs-on:
- environment=production
- size=xlarge
- provider=ethpandaops
- realm=platform
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
- name: Derive release suffix from tag (if it exists)
run: |
# Strip the 'refs/tags/' prefix
TAG_NAME=${GITHUB_REF#refs/tags/}
# Extract suffix from tag name after the last '-' (e.g., 'dencun' from 'v1.0.0-dencun')
RELEASE_SUFFIX=${TAG_NAME##*-}
# Check if the suffix is still a version pattern (e.g., 'v0.0.44'), in which case there's no suffix
if [[ $RELEASE_SUFFIX =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
RELEASE_SUFFIX=""
fi
echo "RELEASE_SUFFIX=$RELEASE_SUFFIX" >> $GITHUB_ENV
echo "Release suffix: $RELEASE_SUFFIX"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.19'
-
name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
- name: Run apt-get update
run: sudo apt-get update
- name: Install cross-compiler for linux/arm64
run: sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Install make
run: sudo apt-get -y install make
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Context for Buildx
shell: bash
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Run GoReleaser
- name: Update GoReleaser config
run: |
cp .goreleaser.yaml ../.goreleaser.yaml.new
# If we have a RELEASE_SUFFIX, update the goreleaser config to not set
# the release as the latest
if [[ -n "$RELEASE_SUFFIX" ]]; then
echo "release:" >> ../.goreleaser.yaml.new
echo " prerelease: true" >> ../.goreleaser.yaml.new
echo " make_latest: false" >> ../.goreleaser.yaml.new
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean --config ../.goreleaser.yaml.new
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_SUFFIX: ${{ env.RELEASE_SUFFIX }}
40 changes: 20 additions & 20 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ dockers:
dockerfile: goreleaser-scratch.Dockerfile
image_templates:
- "samcm/{{ .ProjectName }}:{{ .Version }}-amd64"
- "samcm/{{ .ProjectName }}:latest-amd64"
- "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64"
- "ethpandaops/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ethpandaops/{{ .ProjectName }}:latest-amd64"
- "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -59,9 +59,9 @@ dockers:
dockerfile: goreleaser-scratch.Dockerfile
image_templates:
- "samcm/{{ .ProjectName }}:{{ .Version }}-arm64v8"
- "samcm/{{ .ProjectName }}:latest-arm64v8"
- "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8"
- "ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64v8"
- "ethpandaops/{{ .ProjectName }}:latest-arm64v8"
- "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8"
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -75,9 +75,9 @@ dockers:
dockerfile: goreleaser-debian.Dockerfile
image_templates:
- "samcm/{{ .ProjectName }}:{{ .Version }}-debian-amd64"
- "samcm/{{ .ProjectName }}:debian-latest-amd64"
- "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64"
- "ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-amd64"
- "ethpandaops/{{ .ProjectName }}:debian-latest-amd64"
- "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -90,9 +90,9 @@ dockers:
dockerfile: goreleaser-debian.Dockerfile
image_templates:
- "samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8"
- "samcm/{{ .ProjectName }}:debian-latest-arm64v8"
- "samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8"
- "ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8"
- "ethpandaops/{{ .ProjectName }}:debian-latest-arm64v8"
- "ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8"
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -108,10 +108,10 @@ docker_manifests:
- name_template: samcm/{{ .ProjectName }}:{{ .Version }}-arm64
image_templates:
- samcm/{{ .ProjectName }}:{{ .Version }}-arm64v8
- name_template: samcm/{{ .ProjectName }}:latest
- name_template: samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest
image_templates:
- samcm/{{ .ProjectName }}:latest-amd64
- samcm/{{ .ProjectName }}:latest-arm64v8
- samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64
- samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8

- name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}
image_templates:
Expand All @@ -120,10 +120,10 @@ docker_manifests:
- name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64
image_templates:
- ethpandaops/{{ .ProjectName }}:{{ .Version }}-arm64v8
- name_template: ethpandaops/{{ .ProjectName }}:latest
- name_template: ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest
image_templates:
- ethpandaops/{{ .ProjectName }}:latest-amd64
- ethpandaops/{{ .ProjectName }}:latest-arm64v8
- ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-amd64
- ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}latest-arm64v8

## Debian
- name_template: samcm/{{ .ProjectName }}:{{ .Version }}-debian
Expand All @@ -133,18 +133,18 @@ docker_manifests:
- name_template: samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64
image_templates:
- samcm/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8
- name_template: samcm/{{ .ProjectName }}:debian-latest
- name_template: samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest
image_templates:
- samcm/{{ .ProjectName }}:debian-latest-amd64
- samcm/{{ .ProjectName }}:debian-latest-arm64v8
- samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64
- samcm/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8
- name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian
image_templates:
- ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-amd64
- ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8
- name_template: ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64
image_templates:
- ethpandaops/{{ .ProjectName }}:{{ .Version }}-debian-arm64v8
- name_template: ethpandaops/{{ .ProjectName }}:debian-latest
- name_template: ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest
image_templates:
- ethpandaops/{{ .ProjectName }}:debian-latest-amd64
- ethpandaops/{{ .ProjectName }}:debian-latest-arm64v8
- ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-amd64
- ethpandaops/{{ .ProjectName }}:{{ if .Env.RELEASE_SUFFIX }}{{ .Env.RELEASE_SUFFIX }}-{{ end }}debian-latest-arm64v8
55 changes: 36 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,69 @@ module github.com/ethpandaops/checkpointz

go 1.17

replace github.com/attestantio/go-eth2-client v0.15.7 => github.com/gnosischain/go-eth2-client v0.0.0-20230803220918-d35ee0a2d66b

replace github.com/ethpandaops/beacon v0.25.0 => github.com/gnosischain/beacon v0.0.0-20230803222300-e5ee3a99f02b

require (
github.com/attestantio/go-eth2-client v0.15.7
github.com/attestantio/go-eth2-client v0.18.2
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9
github.com/creasty/defaults v1.6.0
github.com/ethpandaops/beacon v0.25.0
github.com/ethpandaops/beacon v0.28.0
github.com/go-co-op/gocron v1.18.0
github.com/julienschmidt/httprouter v1.3.0
github.com/nanmu42/gzip v1.2.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/client_golang v1.16.0
github.com/sirupsen/logrus v1.9.1
github.com/spf13/cobra v1.6.1
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/ethpandaops/ethwallclock v0.2.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/ferranbt/fastssz v0.1.2 // indirect
github.com/ferranbt/fastssz v0.1.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.7.4 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.9.0 // indirect
github.com/goccy/go-yaml v1.9.5 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/holiman/uint256 v1.2.2 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/cpuid/v2 v2.1.2 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 // indirect
github.com/r3labs/sse/v2 v2.8.1 // indirect
github.com/r3labs/sse/v2 v2.10.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rs/zerolog v1.27.0 // indirect
github.com/rs/zerolog v1.29.1 // indirect
github.com/signalsciences/ac v1.2.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.2.0 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
)
Loading

0 comments on commit a6eb4e3

Please sign in to comment.