Skip to content

Commit 4484015

Browse files
committed
Add artifacts schema
1 parent d84506b commit 4484015

File tree

2 files changed

+444
-8
lines changed

2 files changed

+444
-8
lines changed

schema/v2/artifacts.schema.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://pgxn.org/meta/v2/artifacts.schema.json",
4+
"title": "Artifacts",
5+
"description": "*Artifacts* describes non-PGXN links and checksums for downloading the distribution in one or more formats, including source code, binaries, system packages, etc. Consumers **MAY** use this information to determine the best option for installing an extension on a particular system. Useful for projects that publish their own binaries, such as in GitHub releases.",
6+
"type": "array",
7+
"minItems": 1,
8+
"items": {
9+
"type": "object",
10+
"properties": {
11+
"url": {
12+
"type": "string",
13+
"format": "uri",
14+
"description": "The URL to download the artifact."
15+
},
16+
"type": {
17+
"type": "string",
18+
"minLength": 2,
19+
"pattern": "^[a-z0-9]{2,}$",
20+
"description": "The type of artifact. **MUST** be a single lowercase word describing the artifact, such as none of `binary`, `source`, `rpm`, `homebrew`, etc."
21+
},
22+
"platform": {
23+
"$ref": "platform.schema.json",
24+
"description": "Identifies the platform the artifact was built for. **RECOMMENDED** for packages compiled for a specific platform, such as a C extension compiled for `linux-arm64`."
25+
},
26+
"sha256": {
27+
"type": "string",
28+
"pattern": "^[0-9a-fA-F]{64}$",
29+
"description": "The SHA-256 checksum for the artifact in hex format."
30+
},
31+
"sha512": {
32+
"type": "string",
33+
"pattern": "^[0-9a-fA-F]{128}$",
34+
"description": "The SHA-512 checksum for the artifact in hex format."
35+
}
36+
},
37+
"anyOf": [
38+
{ "required": ["url", "type", "sha256"] },
39+
{ "required": ["url", "type", "sha512"] }
40+
],
41+
"patternProperties": { "^[xX]_.": { "description": "Custom key" } },
42+
"additionalProperties": false
43+
},
44+
"examples": [
45+
[
46+
{
47+
"type": "source",
48+
"url": "https://github.com/theory/pg-pair/releases/download/v1.1.0/pair-1.1.0.zip",
49+
"sha256": "2b9d2416096d2930be51e5332b70bcd97846947777a93e4a3d65fe1b5fd7b004"
50+
},
51+
{
52+
"type": "binary",
53+
"url": "https://github.com/theory/pg-pair/releases/download/v1.1.0/pair-1.1.0-linux-amd64.tar.gz",
54+
"sha256": "ec33656ba693c01be2b2b500c639846fb0ede7f7f8ee1f4c157bc9cab53c8500"
55+
},
56+
{
57+
"type": "binary",
58+
"url": "https://github.com/theory/pg-pair/releases/download/v1.1.0/pair-1.1.0-linux-arm64.tar.gz",
59+
"sha512": "612ad0a8b7e292daf0c723bd0ac8029a838357b2d3abbada7cd7445f7690191abd6593a1336742e705314df81fc1c0063423f62e4abd846f350c251ef6a6a24f"
60+
}
61+
]
62+
]
63+
}

0 commit comments

Comments
 (0)