Skip to content

Commit

Permalink
optimism: Add scheduled CI job to check that the latest geth release …
Browse files Browse the repository at this point in the history
…has been merged in
  • Loading branch information
ajsutton committed Mar 21, 2023
1 parent 11f0554 commit 7eee103
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .circleci/check-releases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail

LATEST_RELEASE=$(curl -s --fail -L \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ethereum/go-ethereum/releases \
| jq -r '(.[] | select(.draft==false) | select(.prerelease==false)).tag_name' | head -n 1)

echo "Detected latest go-ethereum release as ${LATEST_RELEASE}"

git remote add upstream https://github.com/ethereum/go-ethereum
git fetch upstream > /dev/null

if git branch --contains "${LATEST_RELEASE}" 2>&1 | grep -e '^[ *]*optimism$' > /dev/null
then
echo "Up to date with latest release. Great job! 🎉"
else
echo "Release has not been merged"
exit 1
fi
28 changes: 27 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: 2.1

orbs:
gcp-cli: circleci/gcp-cli@3.0.1
slack: circleci/slack@4.10.1

commands:
gcp-oidc-authenticate:
Expand Down Expand Up @@ -120,6 +121,19 @@ jobs:
- checkout
- run:
command: go run build/ci.go lint
check-releases:
docker:
- image: cimg/go:1.19
steps:
- checkout
- run:
command: .circleci/check-releases.sh
- slack/notify:
channel: C03N11M0BBN
branch_pattern: optimism
event: fail
template: basic_fail_1


workflows:
main:
Expand Down Expand Up @@ -155,4 +169,16 @@ workflows:
context:
- oplabs-gcr-release
requires:
- hold
- hold
scheduled:
triggers:
- schedule:
# run daily
cron: "0 0 * * *"
filters:
branches:
only: [ "optimism" ]
jobs:
- check-releases:
name: Check for new upstream releases
context: slack

0 comments on commit 7eee103

Please sign in to comment.