Skip to content

Commit

Permalink
Merge pull request #578 from etherisc/feature/github-action-deploy-fi…
Browse files Browse the repository at this point in the history
…re-example

Feature/github-action-deploy-fire-example
  • Loading branch information
doerfli authored Aug 9, 2024
2 parents c16a73d + 584caa5 commit f62dcdf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
permissions:
contents: read
# id-token: write
needs: [build_hardhat, build_foundry, test_foundry]
needs: [build_hardhat, build_foundry]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -175,8 +175,11 @@ jobs:
npm install -g hardhat-shorthand
npm install
- name: Run deployment script
- name: Run deployment script for gif and fire components
env:
SKIP_VERIFICATION: true
run: hh run scripts/deploy_all.ts

WRITE_ADDRESSES_TO_FILE: true
run: |
hh node > /dev/null 2>&1 &
hh run scripts/deploy_all.ts --network localhost
mv deployment.env .env
hh run scripts/deploy_fire_components.ts --network localhost
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ lcov.info
.*.drawio.bkp
deployments/
soljson*.js
deployment.env
10 changes: 8 additions & 2 deletions scripts/deploy_all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { RegistryAddresses, deployAndInitializeRegistry } from "./libs/registry"
import { ServiceAddresses, deployAndRegisterServices } from "./libs/services";
import { loadVerificationQueueState } from "./libs/verification_queue";
import { logger } from "./logger";
import { WRITE_ADDRESSES_TO_FILE } from "./libs/constants";
import fs from "fs";


async function main() {
Expand Down Expand Up @@ -124,8 +126,8 @@ function printAddresses(
// distributionAddress: AddressLike, distributionNftId: string,
// productAddress: AddressLike, productNftId: string,
) {
let addresses = "\nAddresses of deployed smart contracts:\n==========\n";
addresses += `Library Addresses:\n----------\n`;
let addresses = "\n# Addresses of deployed smart contracts:\n# ==========\n";
addresses += `# Library Addresses:\n# ----------\n`;
for (const lib in libraries) {
let libName = lib.toUpperCase();
libName = libName.replace("ADDRESS", "_ADDRESS");
Expand Down Expand Up @@ -212,6 +214,10 @@ function printAddresses(
// addresses += `productNftId: ${productNftId}\n`;

logger.info(addresses);

if (WRITE_ADDRESSES_TO_FILE) {
fs.writeFileSync("deployment.env", addresses);
}
}

main().catch((error) => {
Expand Down
1 change: 1 addition & 0 deletions scripts/libs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export const POOL_IS_VERIFYING = process.env.POOL_IS_VERIFYING != undefined ? pr
export const POOL_COLLATERALIZATION_LEVEL = parseFloat(process.env.POOL_COLLATERALIZATION_LEVEL || "1");
export const DISTRIBUTION_IS_VERIFYING = process.env.DISTRIBUTION_IS_VERIFYING != undefined ? process.env.DISTRIBUTION_IS_VERIFYING.toLowerCase() === "true" : true;
export const GAS_PRICE = process.env.GAS_PRICE !== undefined ? parseInt(process.env.GAS_PRICE) : undefined;
export const WRITE_ADDRESSES_TO_FILE = process.env.WRITE_ADDRESSES_TO_FILE != undefined ? process.env.WRITE_ADDRESSES_TO_FILE.toLowerCase() === "true" : false;

0 comments on commit f62dcdf

Please sign in to comment.