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 4027513 commit da32649
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ 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
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "feat: updating deployment files"
Expand Down
39 changes: 24 additions & 15 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,36 @@ import "@typechain/hardhat";
import dotenv from "dotenv";
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;

const externalDeployments = {
bsctestnet: [
"node_modules/@venusprotocol/venus-protocol/deployments/bsctestnet",
"node_modules/@venusprotocol/governance-contracts/deployments/bsctestnet",
],
sepolia: [
"node_modules/@venusprotocol/venus-protocol/deployments/sepolia",
"node_modules/@venusprotocol/governance-contracts/deployments/sepolia",
],
bscmainnet: [
"node_modules/@venusprotocol/venus-protocol/deployments/bscmainnet",
"node_modules/@venusprotocol/governance-contracts/deployments/bscmainnet",
],
};

extendConfig((config: HardhatConfig) => {
if (process.env.EXPORT !== "true") {
config.external = { ...config.external, deployments: externalDeployments };
}
});

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

Expand Down Expand Up @@ -161,20 +183,7 @@ const config: HardhatUserConfig = {
artifacts: "./artifacts",
},
external: {
deployments: {
bsctestnet: [
"node_modules/@venusprotocol/venus-protocol/deployments/bsctestnet",
"node_modules/@venusprotocol/governance-contracts/deployments/bsctestnet",
],
sepolia: [
"node_modules/@venusprotocol/venus-protocol/deployments/sepolia",
"node_modules/@venusprotocol/governance-contracts/deployments/sepolia",
],
bscmainnet: [
"node_modules/@venusprotocol/venus-protocol/deployments/bscmainnet",
"node_modules/@venusprotocol/governance-contracts/deployments/bscmainnet",
],
},
deployments: {},
},
mocha: {
timeout: 200000000,
Expand Down

0 comments on commit da32649

Please sign in to comment.