1414 - arbitrumSepolia
1515 - arbitrum
1616 default : ' anvil'
17- environment :
18- description : ' Environment'
19- required : true
20- type : choice
21- options :
22- - testnets
23- - mainnets
24- default : ' testnets'
2517
2618jobs :
2719
28- # Validate deployment network and environment.
29- validate :
30- runs-on : ubuntu-latest
31- steps :
32- # On Github, the environment `mainnets` is restricted to
33- # the main branch. Here we check that it's only used with
34- # mainnet networks.
35- - name : Validate mainnet deployment
36- run : |
37- if [[ "${{ inputs.environment }}" == "mainnets" && "${{ inputs.network }}" != "arbitrum" && "${{ inputs.network }}" != "ethereum" ]]; then
38- echo "::error::mainnets environment can only be used with mainnet networks (ethereum, arbitrum)."
39- exit 1
40- fi
41- echo "Deploying to network '${{ inputs.network }}' with environment '${{ inputs.environment }}'."
42-
4320 # Build and test before deploying.
4421 ci :
45- needs : validate
4622 uses : ./.github/workflows/main.yml
4723 secrets :
48- SEPOLIA_RPC_URL : ${{ secrets .SEPOLIA_RPC_URL }}
49- ARBITRUM_SEPOLIA_RPC_URL : ${{ secrets .ARBITRUM_SEPOLIA_RPC_URL }}
24+ SEPOLIA_RPC_URL : ${{ vars .SEPOLIA_RPC_URL }}
25+ ARBITRUM_SEPOLIA_RPC_URL : ${{ vars .ARBITRUM_SEPOLIA_RPC_URL }}
5026
5127 # Deploy and verify contract.
5228 deploy :
5329 needs : ci
5430 runs-on : ubuntu-latest
5531 permissions :
5632 contents : write # Required to commit deployment files.
57- environment : ${{ inputs.environment }}
33+ environment : ${{ inputs.network }}
5834 steps :
5935 - uses : actions/checkout@v4
6036 with :
@@ -71,31 +47,31 @@ jobs:
7147 env :
7248 CI : true
7349 PRIVATE_KEY : ${{ secrets.DEPLOYER_PRIVATE_KEY }}
74- SEPOLIA_RPC_URL : ${{ secrets .SEPOLIA_RPC_URL }}
75- ARBITRUM_SEPOLIA_RPC_URL : ${{ secrets .ARBITRUM_SEPOLIA_RPC_URL }}
76- ANVIL_SEPOLIA_RPC_URL : http://localhost:8545
77- ANVIL_ARBITRUM_SEPOLIA_RPC_URL : http://localhost:8546
50+ SEPOLIA_RPC_URL : ${{ vars .SEPOLIA_RPC_URL }}
51+ ARBITRUM_SEPOLIA_RPC_URL : ${{ vars .ARBITRUM_SEPOLIA_RPC_URL }}
52+ ANVIL_SEPOLIA_RPC_URL : ${{ vars.ANVIL_SEPOLIA_RPC_URL }}
53+ ANVIL_ARBITRUM_SEPOLIA_RPC_URL : ${{ vars.ANVIL_ARBITRUM_SEPOLIA_RPC_URL }}
7854 run : |
7955 make fork-sepolia & make fork-arbitrum-sepolia & sleep 10 && make deploy-on-anvil
8056
81- - name : Deploy contracts on Ethereum Mainnet or Sepolia
57+ - name : Deploy contracts on Sepolia/EthereumMainnet
8258 if : inputs.network == 'sepolia' || inputs.network == 'ethereum'
8359 env :
8460 CI : true
8561 PRIVATE_KEY : ${{ secrets.DEPLOYER_PRIVATE_KEY }}
8662 CHAIN : ${{ inputs.network }}
87- RPC_URL : ${{ inputs.network == 'sepolia' && secrets.SEPOLIA_RPC_URL || secrets.ETHEREUM_RPC_URL }}
63+ RPC_URL : ${{ secrets.RPC_URL }}
8864 run : |
8965 CONTRACT=RLCLiquidityUnifier make deploy-contract
9066 CONTRACT=bridges/layerZero/IexecLayerZeroBridge make deploy-contract
9167
92- - name : Deploy contracts on Arbitrum/Arbitrum Sepolia (L2)
93- if : inputs.network == 'arbitrumSepolia' || inputs.network == 'arbitrum '
68+ - name : Deploy contracts on ChainX
69+ if : inputs.network != 'sepolia' && inputs.network != 'ethereum '
9470 env :
9571 CI : true
9672 PRIVATE_KEY : ${{ secrets.DEPLOYER_PRIVATE_KEY }}
97- CHAIN : ${{ inputs.network == 'arbitrumSepolia' && 'arbitrum_sepolia' || 'arbitrum' }}
98- RPC_URL : ${{ inputs.network == 'arbitrumSepolia' && secrets.ARBITRUM_SEPOLIA_RPC_URL || secrets.ARBITRUM_RPC_URL }}
73+ CHAIN : ${{ inputs.network }}
74+ RPC_URL : ${{ secrets.RPC_URL }}
9975 run : |
10076 CONTRACT=RLCCrosschainToken make deploy-contract
10177 CONTRACT=bridges/layerZero/IexecLayerZeroBridge make deploy-contract
10480 if : inputs.network != 'anvil'
10581 uses : stefanzweifel/git-auto-commit-action@v5
10682 with :
107- commit_message : ' chore: save deployment artifacts for ${{ inputs.network }} (${{ inputs.environment }}, ${{ github.run_id }})'
83+ commit_message : ' chore: save deployment artifacts for ${{ inputs.network }} (${{ github.run_id }})'
10884 file_pattern : ' config/config.json broadcast/'
10985 commit_user_name : ' GitHub Actions Bot'
11086 commit_user_email : ' github-actions[bot]@users.noreply.github.com'
0 commit comments