Skip to content

Commit

Permalink
Add remaining deployment github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Leonard authored and Robert Leonard committed Sep 14, 2023
1 parent d948f75 commit 1288d18
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 12 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/mainnet-deployment-upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: bnb-main-deployment-upgrade

on:
workflow_dispatch:

env:
DEFENDER_KEY: ${{ secrets.DEFENDER_KEY }}
DEFENDER_SECRET: ${{ secrets.DEFENDER_SECRET }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
strategy:
fail-fast: true

name: Bnb testnet deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install hardhat dependencies
run: |
npm install
id: install-hardhat-dependencies

- name: Run deployment script
run: npm run mainnet-upgrade-and-verify-contract
id: upgrade-and-verify
57 changes: 57 additions & 0 deletions .github/workflows/mainnet-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: bnb-main-deployment

on:
workflow_dispatch:

env:
DEFENDER_KEY: ${{ secrets.DEFENDER_KEY }}
DEFENDER_SECRET: ${{ secrets.DEFENDER_SECRET }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
strategy:
fail-fast: true

name: Bnb testnet deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install hardhat dependencies
run: |
npm install
id: install-hardhat-dependencies

- name: Run deployment script
run: npm run mainnet-deploy-and-verify-contract
id: deploy-and-verify
59 changes: 59 additions & 0 deletions .github/workflows/testnet-deployment-upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: bnb-testnet-upgrade-deployment

on:
push:
branches:
- main

env:
DEFENDER_KEY: ${{ secrets.DEFENDER_KEY }}
DEFENDER_SECRET: ${{ secrets.DEFENDER_SECRET }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
strategy:
fail-fast: true

name: Bnb testnet deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install hardhat dependencies
run: |
npm install
id: install-hardhat-dependencies

- name: Run deployment script
run: npm run testnet-upgrade-and-verify-contract
id: upgrade-and-verify
8 changes: 4 additions & 4 deletions .github/workflows/testnet-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
env:
DEFENDER_KEY: ${{ secrets.DEFENDER_KEY }}
DEFENDER_SECRET: ${{ secrets.DEFENDER_SECRET }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:

- name: Run deployment script
run: npm run testnet-deploy-and-verify-contract
id: coverage
id: deploy-and-verify
10 changes: 3 additions & 7 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
DEFENDER_KEY=
DEFENDER_SECRET=

DEFENDER_BNB_RELAY_KEY=
DEFENDER_BNB_RELAY_SECRET=

DEFENDER_TESTNET_BNB_RELAY_KEY=
DEFENDER_TESTNET_BNB_RELAY_SECRET=
DEFENDER_RELAY_KEY=
DEFENDER_RELAY_SECRET=

DID_REGISTRY_PROXY_ADDRESS=
GNOSIS_ADDRESS=

EXPLORER_API_KEY=
BNB_EXPLORER_API_KEY=

BNB_TESTNET_RPC_URL=
BNB_RPC_URL=
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const config: HardhatUserConfig = {
}
},
etherscan: {
apiKey: process.env.EXPLORER_API_KEY!
apiKey: process.env.BNB_EXPLORER_API_KEY!
},
preprocess: {
eachLine: (hre) => ({
Expand Down

0 comments on commit 1288d18

Please sign in to comment.