Skip to content

Commit

Permalink
fix: storage artifacts generation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Oct 17, 2024
1 parent 4bdfffa commit b44ea46
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/generate-storage-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ jobs:
id: set-matrix
working-directory: packages/contracts
run: |
# Find all contracts matching the patterns in core and libraries
find src/dollar/core -name '*.sol' > contracts.txt
find src/dollar/libraries -name 'Lib*.sol' >> contracts.txt
# Generate the matrix from the list of contracts
if [ -s contracts.txt ]; then
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_OUTPUT
fi
# Collect all contracts from core and libraries
CONTRACTS="$(find src/dollar/core/*.sol src/dollar/libraries/Lib*.sol -type f)"
for CONTRACT in $CONTRACTS; do
# Extract the contract name without the .sol extension
CONTRACT_NAME=$(basename "$CONTRACT" .sol)
# Write <contract path>:<contract name> to contracts.txt
echo "${CONTRACT}:${CONTRACT_NAME}" >> contracts.txt
done
# Set the matrix output
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand Down

0 comments on commit b44ea46

Please sign in to comment.