-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
129 changed files
with
6,848 additions
and
2,503 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.dockerignore | ||
.DS_Store | ||
.env | ||
.gitignore | ||
coverage/ | ||
dist/ | ||
node_modules/ |
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,70 @@ | ||
name: Backmerge main to dev | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
backmerge: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Important: fetch all history | ||
ref: dev # Checkout dev branch | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name 'Cannon Bot' | ||
git config user.email 'noreply@usecannon.com' | ||
- name: Merge main into dev | ||
id: merge | ||
continue-on-error: true | ||
run: | | ||
git fetch origin main | ||
git merge origin/main --no-edit | ||
- name: Push if merge successful | ||
if: steps.merge.outcome == 'success' | ||
run: git push origin dev | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create PR on merge conflict | ||
if: steps.merge.outcome == 'failure' | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const branchName = `backmerge/main-to-dev-${{ github.sha }}`; | ||
await exec.exec('git', ['checkout', '-b', branchName]); | ||
await exec.exec('git', ['push', 'origin', branchName]); | ||
const pr = await github.rest.pulls.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: 'chore(ci): backmerge main → dev', | ||
body: 'Automatic merge from main to dev failed. This PR was created to help resolve conflicts.', | ||
head: branchName, | ||
base: 'dev' | ||
}); | ||
// Request review from Core Contributors team | ||
await github.rest.pulls.requestReviewers({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: pr.data.number, | ||
team_reviewers: ['core-contributors'] | ||
}); | ||
// Enable auto-merge | ||
await github.rest.pulls.updateBranch({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: pr.data.number, | ||
merge_method: 'merge' | ||
}); |
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,70 @@ | ||
name: Build and Push Docker Images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
job_to_run: | ||
description: 'Which job to run' | ||
required: true | ||
type: choice | ||
options: | ||
- all | ||
- repo | ||
- indexer | ||
version: | ||
description: 'Version tag (optional)' | ||
required: false | ||
type: string | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
image: ${{ fromJSON(github.event.inputs.job_to_run == 'all' && '["repo", "indexer"]' || format('["%s"]', github.event.inputs.job_to_run)) }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
env: | ||
IMAGE_NAME: ${{ github.repository_owner }}/${{ matrix.image }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.PACKAGES_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Extract metadata (tags, labels) | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
labels: | | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./docker/${{ matrix.image }}.Dockerfile | ||
build-args: | | ||
BUILD_REVISION=${{ github.event.inputs.version || github.sha }} | ||
push: true | ||
platforms: linux/amd64 | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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
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,54 @@ | ||
name: usecannon | ||
|
||
services: | ||
# redis database image, used by indexer and api | ||
redis: | ||
image: redis/redis-stack:7.4.0-v1 | ||
restart: always | ||
ports: | ||
- '6379:6379' | ||
- '8001:8001' | ||
command: redis-stack-server --save 60 1 --loglevel warning | ||
healthcheck: | ||
test: ['CMD', 'redis-cli', 'ping'] | ||
interval: 5s | ||
timeout: 3s | ||
retries: 5 | ||
|
||
# supersim spins up the necessary OPs chains for the registry, and makes | ||
# sure all cross chain messaging works. | ||
# registry: | ||
# image: ghcr.io/usecannon/supersim:0.1.0-alpha.25 | ||
# restart: always | ||
# environment: | ||
# ANVIL_IP_ADDR: 0.0.0.0 | ||
# ports: | ||
# - '0.0.0.0:8545:8545' # L1 | ||
# - '0.0.0.0:9545:9545' # L2 | ||
# command: --interop.autorelay | ||
|
||
# Deploy the registry on L1 | ||
registry: | ||
restart: always | ||
image: node:22.11.0-alpine | ||
# command: npx -y @usecannon/cli build registry --wipe --rpc-url https://registry:8545 | ||
command: | | ||
curl -L https://foundry.paradigm.xyz | bash | ||
PATH="/root/.foundry/bin:${PATH}" | ||
foundryup --version nightly-fdd321bac95f0935529164a88faf99d4d5cfa321 | ||
DEBUG=cannon* npx -y @usecannon/cli run registry --anvil.host 0.0.0.0 --anvil.port 8545 --anvil.chain-id 1 | ||
ports: | ||
- '0.0.0.0:8545:8545' # L1 | ||
|
||
repo: | ||
build: | ||
context: . | ||
dockerfile: docker/repo.Dockerfile | ||
restart: always | ||
depends_on: | ||
- redis | ||
environment: | ||
REDIS_URL: redis://redis:6379 | ||
UPSTREAM_IPFS_URL: http://localhost:9095 | ||
ports: | ||
- '3000:3000' |
Oops, something went wrong.