File tree Expand file tree Collapse file tree 1 file changed +32
-9
lines changed
Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,27 @@ name: Upgrade
22on :
33 workflow_dispatch :
44 inputs :
5- network :
6- description : ' Network'
7- required : true
8- type : choice
9- options :
10- - hardhat
11- - bellecour
5+ network_type :
6+ description : ' Network Type (mainnets or testnets)'
7+ required : true
8+ type : choice
9+ options :
10+ - mainnets
11+ - testnets
12+ network :
13+ description : ' Network'
14+ required : true
15+ type : choice
16+ options :
17+ - hardhat
18+ - bellecour
19+ - viviani
1220jobs :
1321 upgrade :
1422 runs-on : ubuntu-latest
1523 permissions :
1624 contents : write # required by git-auto-commit-action
17- environment : ${{ inputs.network }} # Secrets for an environment are already limited to deployments on specific branches
25+ environment : ${{ inputs.network_type }} # Secrets for an environment are already limited to deployments on specific branches
1826 steps :
1927 - name : Checkout
2028 uses : actions/checkout@v4
@@ -25,11 +33,26 @@ jobs:
2533 cache : ' npm'
2634 - name : Install dependencies
2735 run : npm ci
36+ - name : Set private key based on network
37+ id : set-private-key
38+ run : |
39+ case "${{ inputs.network }}" in
40+ "bellecour")
41+ echo "PRIVATE_KEY=${{ secrets.BELLECOUR_PRIVATE_KEY }}" >> $GITHUB_ENV
42+ ;;
43+ "viviani")
44+ echo "PRIVATE_KEY=${{ secrets.VIVIANI_PRIVATE_KEY }}" >> $GITHUB_ENV
45+ ;;
46+ *)
47+ echo "PRIVATE_KEY=''" >> $GITHUB_ENV
48+ ;;
49+ esac
50+
2851 - name : Upgrade
2952 env :
3053 NETWORK : ${{ inputs.network }}
3154 IS_LOCAL_FORK : ${{ inputs.network == 'hardhat'}}
32- PROD_PRIVATE_KEY : ${{ inputs.network == 'bellecour' && secrets.PROD_PRIVATE_KEY || '' }}
55+ PROD_PRIVATE_KEY : ${{ env.PRIVATE_KEY }}
3356 run : |
3457 echo "Network: $NETWORK"
3558 echo "Local fork: $IS_LOCAL_FORK"
You can’t perform that action at this time.
0 commit comments