Skip to content

Commit

Permalink
chore: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnabarhorse committed Nov 29, 2024
1 parent f3efd5a commit c345eea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/deploy-alchemy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
AAVEGOTCHI_DIAMOND=$(node -e "console.log(require('./config/$NETWORK.json').contracts.diamond)")
echo "AAVEGOTCHI_DIAMOND=$AAVEGOTCHI_DIAMOND" >> $GITHUB_OUTPUT
- name: Generate Constants
run: |
NETWORK=${{ steps.extract-network.outputs.NETWORK }}
npx ts-node scripts/generate-constants.ts $NETWORK
- name: Replace environment variables
run: |
sed -i "s/{{AAVEGOTCHI_DIAMOND}}/${{ steps.export-vars.outputs.AAVEGOTCHI_DIAMOND }}/g" src/helper.ts
Expand Down
17 changes: 17 additions & 0 deletions scripts/generate-constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import fs from "fs";
import path from "path";

const network = process.argv[2];
const configFile = require(`../config/${network}.json`);

const constants = `// This is an auto-generated file
export const AAVEGOTCHI_DIAMOND = "${configFile.contracts.diamond}";
`;

fs.writeFileSync(
path.join(__dirname, "../src/constants.ts"),
constants,
"utf8"
);

console.log("Constants file generated successfully");

0 comments on commit c345eea

Please sign in to comment.