Weekly Builder Order Update #57
This file contains hidden or 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
| name: Weekly Builder Order Update | |
| on: | |
| schedule: | |
| # Run weekly on Sundays at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-builder-order: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build tools | |
| run: | | |
| cargo build --release -p mev-builders --features tools --bin mev-builders-stats --bin mev-builders-check | |
| - name: Run aggregate stats script | |
| id: aggregate_stats | |
| run: | | |
| target/release/mev-builders-stats --days 7 --output crates/mev-builders/data/builders_stats.json > stats_output.txt | |
| echo "stats_output<<EOF" >> $GITHUB_OUTPUT | |
| cat stats_output.txt >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| rm stats_output.txt | |
| - name: Check builder data consistency | |
| id: check_consistency | |
| run: | | |
| # Run the consistency check and capture output (ignore exit code for now) | |
| target/release/mev-builders-check --builders crates/mev-builders/data/builders.json --stats crates/mev-builders/data/builders_stats.json > consistency_output.txt 2>&1 || true | |
| echo "consistency_output<<EOF" >> $GITHUB_OUTPUT | |
| cat consistency_output.txt >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| rm consistency_output.txt | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| # Check if there are any changes | |
| if git diff --quiet; then | |
| echo "No changes detected" | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| echo "Substantial changes detected (more than comments)" | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| if: steps.check_changes.outputs.has_changes == 'true' | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "chore: weekly builder order update" | |
| title: "chore: weekly builder order update" | |
| body: | | |
| ## Builder Stats Update | |
| ``` | |
| ${{ steps.aggregate_stats.outputs.stats_output }} | |
| ``` | |
| ## Data Consistency Check | |
| ``` | |
| ${{ steps.check_consistency.outputs.consistency_output }} | |
| ``` | |
| branch: weekly-builder-order-update | |
| delete-branch: true | |
| base: main |