Skip to content

Commit

Permalink
fix: exclude external deployments when exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Dec 11, 2023
1 parent c7cbfa3 commit e183ec7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,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
Expand Down
47 changes: 28 additions & 19 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,38 @@ import * as dotenv from "dotenv";
import { parseUnits } from "ethers/lib/utils";
import "hardhat-deploy";
import "hardhat-gas-reporter";
import { HardhatUserConfig, task } from "hardhat/config";
import { HardhatUserConfig, extendConfig, task } from "hardhat/config";
import { HardhatConfig } from "hardhat/types";
import "solidity-coverage";
import "solidity-docgen";

dotenv.config();
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html

extendConfig((config: HardhatConfig) => {
if (process.env.EXPORT !== "true") {
config.external = {
...config.external,
deployments: {
bsctestnet: [
"node_modules/@venusprotocol/governance-contracts/deployments/bsctestnet",
"node_modules/@venusprotocol/venus-protocol/deployments/bsctestnet",
"node_modules/@venusprotocol/oracle/deployments/bsctestnet",
],
bscmainnet: [
"node_modules/@venusprotocol/governance-contracts/deployments/bscmainnet",
"node_modules/@venusprotocol/venus-protocol/deployments/bscmainnet",
"node_modules/@venusprotocol/oracle/deployments/bscmainnet",
],
sepolia: [
"node_modules/@venusprotocol/governance-contracts/deployments/sepolia",
"node_modules/@venusprotocol/oracle/deployments/sepolia",
],
},
};
}
});

task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();

Expand Down Expand Up @@ -180,22 +204,7 @@ const config: HardhatUserConfig = {
templates: "./docgen-templates",
},
external: {
deployments: {
bsctestnet: [
"node_modules/@venusprotocol/governance-contracts/deployments/bsctestnet",
"node_modules/@venusprotocol/venus-protocol/deployments/bsctestnet",
"node_modules/@venusprotocol/oracle/deployments/bsctestnet",
],
bscmainnet: [
"node_modules/@venusprotocol/governance-contracts/deployments/bscmainnet",
"node_modules/@venusprotocol/venus-protocol/deployments/bscmainnet",
"node_modules/@venusprotocol/oracle/deployments/bscmainnet",
],
sepolia: [
"node_modules/@venusprotocol/governance-contracts/deployments/sepolia",
"node_modules/@venusprotocol/oracle/deployments/sepolia",
],
},
deployments: {},
},
};

Expand Down

0 comments on commit e183ec7

Please sign in to comment.