Skip to content

Commit 9f888a9

Browse files
authored
Merge branch 'main' into feature/add-publish-ci
2 parents a4b7234 + 1a68736 commit 9f888a9

File tree

7 files changed

+640
-27
lines changed

7 files changed

+640
-27
lines changed

.github/workflows/upgrade.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@ name: Upgrade
22
on:
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
1219
jobs:
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"

0 commit comments

Comments
 (0)