Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 4, 2024
2 parents 3d02a26 + d73cdab commit ea59037
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 6 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
2 changes: 1 addition & 1 deletion .github/workflows/validate-demo-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
METADATA_FILE_LIST: ${{ needs.generate-metadata-file-list.outputs.metadata_files }}
run: |
cd metadata_schemas
${{ steps.poetry.outputs.bin }} run check-jsonschema -v --traceback-mode full --schemafile demo.metadata.schema.0.1.2.json $METADATA_FILE_LIST
${{ steps.poetry.outputs.bin }} run check-jsonschema -v --traceback-mode full --schemafile demo.metadata.schema.0.1.3.json $METADATA_FILE_LIST
validate-metadata-preview-images:
runs-on: ubuntu-latest
Expand Down
140 changes: 140 additions & 0 deletions metadata_schemas/demo.metadata.schema.0.1.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "demo.metadata.schema.0.1.2.json",
"title": "Demo Metadata",
"description": "A QML demo's metadata",
"type": "object",
"properties": {
"title": {
"description": "The title of the demo.",
"type": "string",
"minLength": 2
},
"slug": {
"description": "The slug of the demo. This should match the base name of the metadata file.",
"type": "string",
"minLength": 1
},
"authors": {
"description": "The author(s) of the demo. This array must contain at least one item.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "file:./objects/author.schema.0.1.0.json"
},
{
"$ref": "file:./objects/author.schema.0.2.0.json"
}
]
},
"minItems": 1
},
"dateOfPublication": {
"description": "The date on which the demo was first published, in the form YYYY-MM-DDTHH:MM:SS+00:00.",
"type": "string",
"format": "date-time",
"minLength": 25,
"maxLength": 25
},
"dateOfLastModification": {
"description": "The date on which the demo was last modified, in the form YYYY-MM-DDTHH:MM:SS+00:00.",
"type": "string",
"format": "date-time",
"minLength": 25,
"maxLength": 25
},
"categories": {
"description": "An array of the categories that this demo is in.",
"type": "array",
"items": {
"enum": [
"Algorithms",
"Getting Started",
"Optimization",
"Quantum Machine Learning",
"Quantum Chemistry",
"Devices and Performance",
"Quantum Computing",
"Quantum Hardware",
"How-to"
]
},
"minItems": 0
},
"tags": {
"description": "An array of the tags that the demo has. An empty array is allowed.",
"type": "array",
"items": {
"type": "string"
}
},
"previewImages": {
"description": "An array of the different images that can be used as previews for this demo - e.g., thumbnails, social media cards (perhaps of different aspect ratios).",
"type": "array",
"items": {
"$ref": "file:./objects/preview.image.schema.0.1.0.json"
},
"minItems": 1
},
"seoDescription": {
"description": "A description of the demo suitable for SEO purposes. Ideally this should be less than 150 characters, but this is not a strict limit. It should be a full, grammatically-correct sentence ending in a full stop.",
"type": "string",
"minLength": 2
},
"doi": {
"description": "The DOI for the demo.",
"type": "string",
"pattern": "^$|^10[.]"
},
"canonicalURL": {
"description": "The canonical URL for the demo. Sometimes there might be more than one URL that points to a given page on a website. The canonical URL defines which of these should be thought of as the primary or main one.",
"type": "string",
"pattern": "(^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6})?\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"
},
"references": {
"description": "An array of the references used for the demo.",
"type": "array",
"items": {
"$ref": "file:./objects/reference.schema.0.1.0.json"
}
},
"basedOnPapers": {
"description": "An array of the DOIs for the papers the demo is based on. An empty array is allowed.",
"type": "array",
"items": {
"type": "string"
}
},
"referencedByPapers": {
"description": "An array of the DOIs of any papers that reference the demo. An empty array is allowed.",
"type": "array",
"items": {
"type": "string"
}
},
"relatedContent": {
"description": "An array of objects describing the content related to the demo. An empty array is allowed.",
"type": "array",
"items": {
"$ref": "file:./objects/related.content.schema.0.1.0.json"
}
},
"hardware": {
"description": "An array of objects representing third-party vendors who can run the demo on their hardware. An empty array is allowed.",
"type": "array",
"items": {
"$ref": "file:./objects/hardware.schema.0.1.0.json"
}
},
"discussionForumUrl": {
"description": "Link to dedicated discussion forum thread on https://discuss.pennylane.ai/ for this demo",
"type": "string",
"format": "uri",
"pattern": "(^https?:\/\/(www.)?discuss.pennylane.ai(?:\/.*)?$)"
}
},
"required": [
"title", "authors", "dateOfPublication", "dateOfLastModification", "categories", "tags", "previewImages", "seoDescription", "doi", "canonicalURL", "references", "basedOnPapers", "referencedByPapers", "relatedContent"
]
}

0 comments on commit ea59037

Please sign in to comment.