diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f627347..09a8cf5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: - name: Export deployments run: | for NETWORK in bsctestnet bscmainnet ethereum sepolia; do - yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json + EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json done yarn prettier diff --git a/hardhat.config.ts b/hardhat.config.ts index 88852315..9ba1032e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -7,12 +7,25 @@ import "@typechain/hardhat"; import * as dotenv from "dotenv"; import "hardhat-deploy"; import "hardhat-gas-reporter"; -import { HardhatUserConfig } from "hardhat/config"; +import { HardhatUserConfig, extendConfig } from "hardhat/config"; +import { HardhatConfig } from "hardhat/types"; import "solidity-coverage"; import "solidity-docgen"; dotenv.config(); +extendConfig((config: HardhatConfig) => { + if (process.env.EXPORT !== "true") { + // eslint-disable-next-line no-param-reassign + config.external = { + ...config.external, + deployments: { + // Define external deployments here + }, + }; + } +}); + function isFork() { return process.env.FORK === "true" ? {