{
  "$id": "https://json.schemastore.org/sourcehut-build-0.65.0.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A recipe for Sourcehut CI service. For details, see https://man.sr.ht/builds.sr.ht/manifest.md.",
  "properties": {
    "image": {
      "description": "Which OS image to build in. A list of available build images can be found at https://man.sr.ht/builds.sr.ht/compatibility.md",
      "type": "string",
      "examples": ["archlinux", "alpine/latest"]
    },
    "arch": {
      "description": "Which architecture to build for. See https://man.sr.ht/builds.sr.ht/compatibility.md for a list of available architectures.",
      "type": "string",
      "examples": ["aarch64", "x86_64"]
    },
    "packages": {
      "description": "A list of packages to install on the image. For image-specific details, consult https://man.sr.ht/builds.sr.ht/compatibility.md",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "repositories": {
      "description": "A list of extra repositories to enable with the image's package manager. The specific format varies by base image, consult https://man.sr.ht/builds.sr.ht/compatibility.md for details.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "artifacts": {
      "description": "A list of files to extract from the completed build environment and make available for downloading from the jobs page. Artifacts are only uploaded for successful jobs and are pruned after 90 days. \nNote that the file names are interpreted literally: do not use ~ or any shell code. If a relative path is used (e.g. example/my-artifact.tar.gz), it will be interpreted relative to the build user's home directory.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "examples": ["example/my-artifact.tar.gz"]
    },
    "shell": {
      "description": "Whether to keep the build VM alive after all of the tasks have finished, even if it doesn't fail, so you can SSH in. You can also SSH in before the tasks have finished and tail the output of the build in your terminal. Learn more at https://man.sr.ht/builds.sr.ht/build-ssh.md",
      "type": "boolean"
    },
    "sources": {
      "description": "A list of repositories to clone into the home directory of the build user in the build environment. Optionally, prefix the protocol with the source control management scheme, to specify a protocol other than git. To specify a non-default git revision, append #commit-object to the repository.",
      "type": "array",
      "items": {
        "type": "string",
        "examples": [
          "https://git.sr.ht/~sircmpwn/scdoc",
          "https://git.sr.ht/~sircmpwn/scdoc#devel",
          "git@git.sr.ht:~sircmpwn/scdoc",
          "hg+https://hg.sr.ht/~sircmpwn/scdoc",
          "hg+ssh://hg.sr.ht/~sircmpwn/scdoc"
        ]
      }
    },
    "tasks": {
      "description": "A list of scripts to execute in the build environment. \nTask names must use only lowercase alphanumeric characters, underscores or dashes and must be <=128 characters in length. Tasks are executed in the order specified. \nEach task is run in a separate login session, so if you modify the groups of the build user they will be effective starting from the subsequent task.",
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "propertyNames": {
          "pattern": "^[a-z0-9_-]{1,128}$"
        },
        "examples": [
          {
            "package": "cd $site\ntar -cvz . > ../site.tar.gz"
          }
        ]
      }
    },
    "triggers": {
      "description": "A list of triggers to execute post-build, which can be used to send emails or do other post-build tasks. \nLearn more at https://man.sr.ht/builds.sr.ht/triggers.md",
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "action": {
            "description": "Trigger type",
            "type": "string",
            "enum": ["email", "webhook"]
          },
          "condition": {
            "description": "When to execute this trigger",
            "type": "string",
            "enum": ["always", "failure", "success"]
          }
        },
        "required": ["action", "condition"]
      }
    },
    "environment": {
      "description": "A list of key/value pairs for options to set in the build environment via ~/.buildenv",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "examples": [
        {
          "site": "your-username.srht.site"
        }
      ]
    },
    "secrets": {
      "description": "List of secret UUIDs to be added to the guest during the build. Learn more at https://man.sr.ht/builds.sr.ht/#secrets",
      "type": "array",
      "items": {
        "type": "string",
        "examples": ["46f739e5-4538-45dd-a79f-bf173b7a2ed9"]
      }
    },
    "oauth": {
      "description": "If present, and secrets are enabled for this build, an OAuth 2.0 bearer token is generated for this build with the given string as the list of grants. The acurl command may be used in the task scripts to perform authenticated GraphAL API requests (https://man.sr.ht/graphql.md).",
      "type": "string",
      "examples": ["pages.sr.ht/PAGES:RW"]
    }
  },
  "required": ["image", "tasks"],
  "title": "Sourcehut Build Manifest",
  "type": "object"
}