Skip to content

Commit

Permalink
Add slug field to aggregate metadata.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mandrenkov committed Oct 3, 2024
1 parent 30813a9 commit 3d2cba8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/upload-text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,21 @@ jobs:
path: qml_text

- name: Copy Concatenated Metadata into Build
run: >
jq -s .
$(find demonstrations -name "*.metadata.json" -type f
! -name "demonstrations_categories.metadata.json")
> ${{ steps.qml_text.outputs.download-path }}/demos/metadata.json
run: |
tmp_metadata_json=$(mktemp)
out_metadata_json=${{ steps.qml_text.outputs.download-path }}/demos/metadata.json
filepaths=$(
find demonstrations -name "*.metadata.json" -type f \
! -name "demonstrations_categories.metadata.json" \
)
for filepath in $filepaths; do
slug=$(basename $filepath .metadata.json)
jq ". += {\"slug\": \"$slug\"}" < $filepath >> $tmp_metadata_json
done
jq --slurp --sort-keys . < $tmp_metadata_json > $out_metadata_json
- name: Upload
uses: XanaduAI/cloud-actions/push-to-s3-and-invalidate-cloudfront@main
Expand Down

0 comments on commit 3d2cba8

Please sign in to comment.