Skip to content

Commit baefd74

Browse files
committed
feat: subgraph build updates
1 parent 63ca7a5 commit baefd74

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/solidity.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,22 @@ jobs:
250250
echo "Subgraph directory is missing or empty"
251251
exit 0
252252
fi
253-
npx graph-compiler --config subgraph/subgraph.config.json --include node_modules/@openzeppelin/subgraphs/src/datasources subgraph/datasources --export-schema --export-subgraph
254-
yq -i e '.specVersion = "1.2.0"' generated/scs.subgraph.yaml
255-
yq -i e '.features = ["nonFatalErrors", "fullTextSearch", "ipfsOnEthereumContracts"]' generated/scs.subgraph.yaml
256-
yq -i e '.dataSources[].mapping.apiVersion = "0.0.7"' generated/scs.subgraph.yaml
257-
yq -i e '.dataSources[].network = "localhost"' generated/scs.subgraph.yaml
258-
yq -i e '.templates[].mapping.apiVersion = "0.0.7"' generated/scs.subgraph.yaml
259-
yq -i e '.templates[].network = "localhost"' generated/scs.subgraph.yaml
260-
npx graph codegen generated/scs.subgraph.yaml
261-
npx graph build generated/scs.subgraph.yaml
253+
if [ -f "subgraph/subgraph.config.json" ]; then
254+
npx graph-compiler --config subgraph/subgraph.config.json --include node_modules/@openzeppelin/subgraphs/src/datasources subgraph/datasources --export-schema --export-subgraph
255+
yq -i e '.specVersion = "1.2.0"' generated/scs.subgraph.yaml
256+
yq -i e '.features = ["nonFatalErrors", "fullTextSearch", "ipfsOnEthereumContracts"]' generated/scs.subgraph.yaml
257+
yq -i e '.dataSources[].mapping.apiVersion = "0.0.7"' generated/scs.subgraph.yaml
258+
yq -i e '.dataSources[].network = "localhost"' generated/scs.subgraph.yaml
259+
yq -i e '.templates[].mapping.apiVersion = "0.0.7"' generated/scs.subgraph.yaml
260+
yq -i e '.templates[].network = "localhost"' generated/scs.subgraph.yaml
261+
npx graph codegen generated/scs.subgraph.yaml
262+
npx graph build --ipfs=https://ipfs.network.thegraph.com generated/scs.subgraph.yaml
263+
else
264+
cd subgraph
265+
npx graph codegen subgraph.yaml
266+
npx graph build --ipfs=https://ipfs.network.thegraph.com subgraph.yaml
267+
fi
268+
262269
263270
- name: Report code coverage
264271
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)