-
Notifications
You must be signed in to change notification settings - Fork 39
87 lines (79 loc) · 3.02 KB
/
verify.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
81
82
83
84
85
86
87
name: Verification
on:
workflow_dispatch:
inputs:
network:
description: The EVM compatible network.
default: goerli
required: true
verifyContracts:
description: Contracts to be verified on etherscan (separated by comma).
default: "*Logic,Pool*,*Oracle,*Gateway*,*DataProvider,ACLManager,Seaport,ApeCoinStaking"
required: true
ref:
description: The deployment commit hash.
required: true
verifyJobs:
description: Number of jobs for verification.
default: "1"
required: true
maxRetries:
description: Maximum retries if verification fails.
default: "3"
required: true
jobs:
verification:
name: Verification
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
env:
INFURA_KEY: ${{ secrets.INFURA_KEY }}
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
CONFIGS_BASE_URL: ${{ secrets.CONFIGS_BASE_URL }}
NETWORK: ${{ github.event.inputs.network }}
ETHERSCAN_VERIFICATION: "true"
ETHERSCAN_VERIFICATION_CONTRACTS: ${{ github.event.inputs.verifyContracts }}
REF: ${{ github.event.inputs.ref }}
ETHERSCAN_VERIFICATION_JOBS: ${{ github.event.inputs.verifyJobs }}
ETHERSCAN_VERIFICATION_MAX_RETRIES: ${{ github.event.inputs.maxRetries }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
submodules: true
ref: ${{ env.REF }}
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: |
yarn cache clean --all
YARN_CHECKSUM_BEHAVIOR=update yarn
yarn
yarn build
- name: Get short deployment id
id: deploymentInfo
run: |
echo "id=$(git rev-parse --short ${{ env.REF }})" >> $GITHUB_OUTPUT
- name: Download deployed-contracts.json
run: |
curl -H 'Authorization: token ${{ secrets.PAT }}' \
-H 'Accept: application/vnd.github.v3.raw' \
-fLo deployed-contracts.json ${{ env.CONFIGS_BASE_URL }}/deployed-contracts.${{ steps.deploymentInfo.outputs.id }}.json
- name: Verification
run: |
echo NETWORK=${{ env.NETWORK }} >> .env
echo INFURA_KEY=${{ env.INFURA_KEY }} >> .env
echo DEPLOYER_MNEMONIC=${{ env.DEPLOYER_MNEMONIC }} >> .env
echo ETHERSCAN_KEY=${{ env.ETHERSCAN_KEY }} >> .env
echo ETHERSCAN_VERIFICATION=${{ env.ETHERSCAN_VERIFICATION }} >> .env
echo ETHERSCAN_VERIFICATION_CONTRACTS=${{ env.ETHERSCAN_VERIFICATION_CONTRACTS }} >> .env
echo ETHERSCAN_VERIFICATION_JOBS=${{ env.ETHERSCAN_VERIFICATION_JOBS }} >> .env
echo ETHERSCAN_VERIFICATION_MAX_RETRIES=${{ env.ETHERSCAN_VERIFICATION_MAX_RETRIES }} >> .env
make verify