Prepare Migration #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Prepare Migration | |
on: | |
workflow_dispatch: | |
inputs: | |
network: | |
type: choice | |
description: Network | |
options: | |
- fuji | |
- mainnet | |
- goerli | |
- sepolia | |
- mumbai | |
- polygon | |
- arbitrum | |
- arbitrum-goerli | |
- base | |
- base-goerli | |
- base-sepolia | |
deployment: | |
description: Deployment Name (e.g. "usdc") | |
required: true | |
migration: | |
description: Migration Name | |
required: true | |
simulate: | |
type: boolean | |
description: Simulate | |
eth_pk: | |
description: Ignore if you plan to use WalletConnect, otherwise, you can paste in a Ethereum private key | |
jobs: | |
prepare-migration: | |
name: Prepare Migration | |
runs-on: ubuntu-latest | |
env: | |
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} | |
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} | |
INFURA_KEY: ${{ secrets.INFURA_KEY }} | |
QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }} | |
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} | |
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} | |
BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} | |
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} | |
steps: | |
- name: Seacrest | |
uses: hayesgm/seacrest@1dc2d6e3750d5f5589173555220695a09b913071 | |
with: | |
wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} | |
requested_network: "${{ inputs.network }}" | |
ethereum_url: "${{ fromJSON('{\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://clean-spring-wind.base-mainnet.discover.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",base-sepolia\":\"https://clean-spring-wind.base-sepolia.discover.quiknode.pro/$QUICKNODE_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\"}')[inputs.network] }}" | |
port: 8585 | |
if: github.event.inputs.eth_pk == '' | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install packages | |
run: yarn install --non-interactive --frozen-lockfile | |
- name: Compile | |
run: yarn hardhat compile | |
- name: Check types | |
run: yarn tsc | |
- name: Run Prepare Migration | |
run: | | |
yarn hardhat migrate --network ${{ github.event.inputs.network }} --deployment ${{ github.event.inputs.deployment }} --prepare --overwrite ${{ fromJSON('["", "--simulate"]')[github.event.inputs.simulate == 'true'] }} ${{ github.event.inputs.migration }} | |
env: | |
DEBUG: true | |
ETH_PK: "${{ inputs.eth_pk }}" | |
NETWORK_PROVIDER: ${{ fromJSON('["", "http://localhost:8585"]')[github.event.inputs.eth_pk == ''] }} | |
REMOTE_ACCOUNTS: ${{ fromJSON('["", "true"]')[github.event.inputs.eth_pk == ''] }} | |
- uses: actions/upload-artifact@v2 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: ${{ github.event.inputs.network }}-${{ github.event.inputs.deployment }}-${{ github.event.inputs.migration }} | |
path: deployments/${{ github.event.inputs.network }}/${{ github.event.inputs.deployment }}/artifacts/${{ github.event.inputs.migration }}.json |