-
Notifications
You must be signed in to change notification settings - Fork 2.2k
69 lines (53 loc) · 2.24 KB
/
fork-diff--preview.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
name: Fork Diff Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_FORK_DIFF }}
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "packages/fork-diff/**"
branches-ignore:
- release-please--branches--**
jobs:
deploy-fork-diff-preview:
if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }}
runs-on: [arc-runner-set]
steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies
- name: Install Vercel CLI
run: pnpm add --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Read tag version from JSON
run: |
echo "TAG_VERSION=$(jq -r '.tagVersion' packages/fork-diff/version_config.json)" >> $GITHUB_ENV
- name: Clone forkdiff
run: git clone https://github.com/protolambda/forkdiff.git
- name: Clone taiko-geth
run: git clone https://github.com/taikoxyz/taiko-geth.git
- name: Clone go-ethereum
run: git clone --branch ${{ env.TAG_VERSION }} https://github.com/ethereum/go-ethereum.git
- name: Replace tag version in configuration file
run: |
sed -i "s/{{ TAG_VERSION }}/${{ env.TAG_VERSION }}/g" packages/fork-diff/fork.yaml
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.0
- name: Generate index.html with forkdiff
run: |
cat packages/fork-diff/fork.yaml
cp packages/fork-diff/fork.yaml forkdiff/fork.yaml
cd forkdiff
go run main.go -repo ../taiko-geth/ -upstream-repo ../go-ethereum/
- name: Move generated index.html to vercel project root
run: |
mv forkdiff/index.html packages/fork-diff/index.html
- name: Deploy Project Artifacts to Vercel
run: vercel --token=${{ secrets.VERCEL_TOKEN }}