File tree Expand file tree Collapse file tree 7 files changed +640
-27
lines changed
Expand file tree Collapse file tree 7 files changed +640
-27
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,26 @@ name: Upgrade
22on :
33 workflow_dispatch :
44 inputs :
5+ environment :
6+ description : ' Github environnment (mainnets or testnets)'
7+ required : true
8+ type : choice
9+ options :
10+ - mainnets
11+ - testnets
512 network :
6- description : ' Network'
7- required : true
8- type : choice
9- options :
10- - hardhat
11- - bellecour
13+ description : ' Network'
14+ required : true
15+ type : choice
16+ options :
17+ - hardhat
18+ - bellecour
1219jobs :
1320 upgrade :
1421 runs-on : ubuntu-latest
1522 permissions :
1623 contents : write # required by git-auto-commit-action
17- environment : ${{ inputs.network }} # Secrets for an environment are already limited to deployments on specific branches
24+ environment : ${{ inputs.environment }} # Secrets for an environment are already limited to deployments on specific branches
1825 steps :
1926 - name : Checkout
2027 uses : actions/checkout@v4
@@ -25,11 +32,21 @@ jobs:
2532 cache : ' npm'
2633 - name : Install dependencies
2734 run : npm ci
35+ - name : Set private key based on network
36+ id : set-private-key
37+ run : |
38+ case "${{ inputs.network }}" in
39+ "bellecour")
40+ echo "PROD_PRIVATE_KEY=${{ secrets.BELLECOUR_PRIVATE_KEY }}" >> $GITHUB_ENV
41+ ;;
42+ *)
43+ echo "PROD_PRIVATE_KEY=''" >> $GITHUB_ENV
44+ ;;
45+ esac
2846 - name : Upgrade
2947 env :
3048 NETWORK : ${{ inputs.network }}
3149 IS_LOCAL_FORK : ${{ inputs.network == 'hardhat'}}
32- PROD_PRIVATE_KEY : ${{ inputs.network == 'bellecour' && secrets.PROD_PRIVATE_KEY || '' }}
3350 run : |
3451 echo "Network: $NETWORK"
3552 echo "Local fork: $IS_LOCAL_FORK"
You can’t perform that action at this time.
0 commit comments