-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (69 loc) · 2.23 KB
/
suave-lib-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: SuaveLib sync
on:
workflow_dispatch:
repository_dispatch:
types: [suavelib-sync]
permissions:
pull-requests: write
issues: write
repository-projects: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Log Dispatch Information
if: ${{ github.event_name == 'repository_dispatch' }}
run: |
echo "this run was triggered by dispatch from repo: flashbots/suave-geth"
echo "ref: ${{ github.event.client_payload.ref }}"
echo "sha: ${{ github.event.client_payload.sha }}"
echo "run: ${{ github.event.client_payload.run }}"
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.21
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: flashbots/suave-geth
path: suave-geth
persist-credentials: false
fetch-depth: 0
- name: Get Commit ID
id: get_commit_id
run: |
cd suave-geth
commit_id=$(git rev-parse HEAD)
echo "commit_ref=https://github.com/flashbots/suave-geth/commit/$commit_id" >> $GITHUB_OUTPUT
- name: Mirror
run: |
cp suave-geth/suave/sol/libraries/Suave.sol ./src/suavelib/Suave.sol
git add ./src/suavelib/Suave.sol
rm -rf suave-geth
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Regenerate Forge registry
run: |
forge build
go run ./tools/forge-gen/main.go --apply
git add ./src/forge/Registry.sol
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Update Suave library"
delete-branch: true
commit-message: Update Suave.sol library to ${{ steps.get_commit_id.outputs.commit_ref }}
branch: bot/suave-lib-update
labels: |
suave-lib-update
automated pr
body: |
Update Suave.sol library to ${{ steps.get_commit_id.outputs.commit_ref }}