release-candidate.v1.schema.json 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "https://zcode.dev/schemas/release-candidate.v1.schema.json",
  4. "title": "ZCode Release Candidate v1",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "required": [
  8. "schemaVersion",
  9. "candidateId",
  10. "source",
  11. "state",
  12. "platforms",
  13. "provenance",
  14. "createdAt"
  15. ],
  16. "properties": {
  17. "schemaVersion": {
  18. "const": "release-candidate.v1"
  19. },
  20. "candidateId": {
  21. "type": "string",
  22. "pattern": "^cand_[A-Za-z0-9_-]{8,128}$"
  23. },
  24. "source": {
  25. "$ref": "#/$defs/source"
  26. },
  27. "state": {
  28. "enum": [
  29. "created",
  30. "building",
  31. "ready",
  32. "approval_pending",
  33. "approved",
  34. "publishing",
  35. "published",
  36. "build_failed",
  37. "rejected",
  38. "publish_failed_retryable",
  39. "cancelled"
  40. ]
  41. },
  42. "platforms": {
  43. "type": "array",
  44. "minItems": 1,
  45. "items": {
  46. "$ref": "#/$defs/platformManifest"
  47. }
  48. },
  49. "provenance": {
  50. "$ref": "#/$defs/provenance"
  51. },
  52. "createdAt": {
  53. "type": "string",
  54. "format": "date-time"
  55. },
  56. "expiresAt": {
  57. "type": "string",
  58. "format": "date-time"
  59. }
  60. },
  61. "$defs": {
  62. "source": {
  63. "type": "object",
  64. "additionalProperties": false,
  65. "required": ["repository", "commit", "version"],
  66. "properties": {
  67. "repository": {
  68. "type": "string",
  69. "minLength": 1,
  70. "maxLength": 256
  71. },
  72. "commit": {
  73. "type": "string",
  74. "pattern": "^[0-9a-f]{40,64}$"
  75. },
  76. "version": {
  77. "type": "string",
  78. "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z.-]+)?$"
  79. },
  80. "ref": {
  81. "type": "string",
  82. "maxLength": 512
  83. }
  84. }
  85. },
  86. "platform": {
  87. "type": "object",
  88. "additionalProperties": false,
  89. "required": ["os", "arch"],
  90. "properties": {
  91. "os": {
  92. "enum": ["macos", "windows", "linux"]
  93. },
  94. "arch": {
  95. "enum": ["x64", "arm64"]
  96. }
  97. }
  98. },
  99. "digest": {
  100. "type": "object",
  101. "additionalProperties": false,
  102. "required": ["sha256", "sha512"],
  103. "properties": {
  104. "sha256": {
  105. "type": "string",
  106. "pattern": "^[a-f0-9]{64}$"
  107. },
  108. "sha512": {
  109. "type": "string",
  110. "pattern": "^[A-Za-z0-9+/]{86}==$"
  111. }
  112. }
  113. },
  114. "artifact": {
  115. "type": "object",
  116. "additionalProperties": false,
  117. "required": ["artifactId", "role", "fileName", "objectKey", "size", "digest"],
  118. "properties": {
  119. "artifactId": {
  120. "type": "string",
  121. "pattern": "^art_[A-Za-z0-9_-]{8,128}$"
  122. },
  123. "role": {
  124. "enum": ["installer", "blockmap", "update_metadata_base", "auxiliary"]
  125. },
  126. "fileName": {
  127. "type": "string",
  128. "minLength": 1,
  129. "maxLength": 512,
  130. "pattern": "^[^/\\\\]+$"
  131. },
  132. "objectKey": {
  133. "type": "string",
  134. "minLength": 1,
  135. "maxLength": 2048,
  136. "pattern": "^[^/].*$"
  137. },
  138. "size": {
  139. "type": "integer",
  140. "minimum": 0
  141. },
  142. "digest": {
  143. "$ref": "#/$defs/digest"
  144. }
  145. }
  146. },
  147. "platformManifest": {
  148. "type": "object",
  149. "additionalProperties": false,
  150. "required": ["platform", "artifacts", "baseUpdateMetadata"],
  151. "properties": {
  152. "platform": {
  153. "$ref": "#/$defs/platform"
  154. },
  155. "artifacts": {
  156. "type": "array",
  157. "minItems": 1,
  158. "items": {
  159. "$ref": "#/$defs/artifact"
  160. }
  161. },
  162. "baseUpdateMetadata": {
  163. "$ref": "#/$defs/artifact"
  164. }
  165. }
  166. },
  167. "provenance": {
  168. "type": "object",
  169. "additionalProperties": false,
  170. "required": ["builder", "builderImage", "tools"],
  171. "properties": {
  172. "builder": {
  173. "type": "string",
  174. "minLength": 1,
  175. "maxLength": 256
  176. },
  177. "builderImage": {
  178. "type": "string",
  179. "minLength": 1,
  180. "maxLength": 512
  181. },
  182. "tools": {
  183. "type": "object",
  184. "minProperties": 1,
  185. "additionalProperties": {
  186. "type": "string",
  187. "maxLength": 256
  188. }
  189. },
  190. "signer": {
  191. "type": "string",
  192. "maxLength": 256
  193. }
  194. }
  195. }
  196. }
  197. }