Skip to content

Commit e0f4022

Browse files
authored
Update deployment CI (#228)
2 parents 1d2c8f7 + 2475bdc commit e0f4022

29 files changed

+126
-161
lines changed

.env.template

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
PRIVATE_KEY=
1+
# Also defined in Github environments
2+
DEPLOYER_PRIVATE_KEY=
3+
EXPLORER_API_KEY=
4+
IS_VERIFICATION_API_V2=
25
ARBISCAN_API_KEY=
6+
7+
# Local development
8+
FUJI_RPC_URL=
9+
ARBITRUM_SEPOLIA_RPC_URL=

.github/workflows/deploy-smart-contracts.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy PoCo Contracts
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
network:
6+
description: 'Network'
7+
required: true
8+
type: choice
9+
options:
10+
- hardhat
11+
- arbitrumSepolia
12+
- arbitrum
13+
- avalancheFujiTestnet
14+
- bellecour
15+
default: 'hardhat'
16+
17+
jobs:
18+
# Build and test before deploying.
19+
build-and-test:
20+
uses: ./.github/workflows/main.yml
21+
22+
deploy:
23+
needs: build-and-test
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write # Required for saving deployment
27+
environment: ${{ inputs.network }} # Use the selected environment
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Nodejs
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 20
36+
cache: 'npm' # Cache dependencies
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Build
42+
run: npm run build
43+
44+
# TODO activate later.
45+
# - name: Run fork tests
46+
# run: |
47+
# if [ "${{ inputs.network }}" == "arbitrumSepolia" ]; then
48+
# npm run test:arbitrumSepolia
49+
# elif [ "${{ inputs.network }}" == "avalancheFujiTestnet" ]; then
50+
# npm run test:fuji
51+
# fi
52+
53+
- name: Deploy contracts
54+
env:
55+
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
56+
RPC_URL: ${{ secrets.RPC_URL }}
57+
ARBISCAN_API_KEY: ${{ secrets.ARBISCAN_API_KEY }}
58+
# TODO: Use Etherscan V2 API
59+
# EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
60+
# IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
61+
run: npm run deploy -- --network ${{ inputs.network }}
62+
63+
- name: Update config.json with ERC1538Proxy address
64+
if: inputs.network != 'hardhat'
65+
env:
66+
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
67+
run: npx hardhat run scripts/tools/update-config.ts --network ${{ inputs.network }}
68+
69+
- name: Save deployment artifacts and updated config
70+
if: inputs.network != 'hardhat'
71+
uses: stefanzweifel/git-auto-commit-action@v5
72+
with:
73+
commit_message: 'chore: Save deployment artifacts for ${{ inputs.network }} (run_id: ${{ github.run_id }})'
74+
file_pattern: 'deployments/${{ inputs.network }}/* config/config.json'
75+
commit_user_name: 'GitHub Actions Bot'
76+
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
77+
commit_author: 'GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>'

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
on:
22
pull_request:
3+
workflow_call:
4+
5+
concurrency:
6+
group: ${{ github.ref }}-ci
7+
cancel-in-progress: true
38

49
jobs:
510
# Note: changing the name of the job disables Slither checks with the error:

config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"factory": "0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed",
177177
"factoryType": "createx",
178178
"DiamondProxy": "0x14B465079537655E1662F012e99EBa3863c8B9E0",
179-
"salt": "0x0000000000000000000000000000000000000000000000000000000000000000"
179+
"salt": "0x00000000244df0848122154315af71fe140f3db0fe014031783b094600000000"
180180
}
181181
},
182182
"default": {

deployments/arbitrumSepolia/AppRegistry.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

deployments/arbitrumSepolia/DatasetRegistry.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

deployments/arbitrumSepolia/ENSIntegrationDelegate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
],
3636
"numDeployments": 2,
3737
"bytecode": "0x608060405234801561001057600080fd5b5061043e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80633121db1c1461003b5780638da5cb5b14610050575b600080fd5b61004e6100493660046102b3565b61006e565b005b6100586100fb565b604051610065919061034b565b60405180910390f35b6100766100fb565b6001600160a01b0316610087610173565b6001600160a01b0316146100b65760405162461bcd60e51b81526004016100ad906103bb565b60405180910390fd5b6100f68383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061017792505050565b505050565b6000306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561013657600080fd5b505afa15801561014a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016e9190610290565b905090565b3390565b6040516302571be360e01b81526001600160a01b038316906302571be3906101c3907f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e29060040161035f565b60206040518083038186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102139190610290565b6001600160a01b031663c47f0027826040518263ffffffff1660e01b815260040161023e9190610368565b602060405180830381600087803b15801561025857600080fd5b505af115801561026c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f69190610333565b6000602082840312156102a1578081fd5b81516102ac816103f0565b9392505050565b6000806000604084860312156102c7578182fd5b83356102d2816103f0565b9250602084013567ffffffffffffffff808211156102ee578384fd5b818601915086601f830112610301578384fd5b81358181111561030f578485fd5b876020828501011115610320578485fd5b6020830194508093505050509250925092565b600060208284031215610344578081fd5b5051919050565b6001600160a01b0391909116815260200190565b90815260200190565b6000602080835283518082850152825b8181101561039457858101830151858201604001528201610378565b818111156103a55783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b038116811461040557600080fd5b5056fea264697066735822122026c2cc2fb2b7ae91ac742f9bc8485fa6b3122ec34aeb657594b9ab5e6ae2b6bf64736f6c634300060c0033"
38-
}
38+
}

0 commit comments

Comments
 (0)