# at.happyproto.registry.publishRelease

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.registry.publishRelease)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.registry.publishRelease/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.registry.publishRelease/examples)

## Definitions

### `at.happyproto.registry.publishRelease`

**Type**: `procedure`

Publish a version of a plugin to the caller's repo. Writes a software.release.manifest carrying the artifact, the changelog as a site.standard.document when one is given, the software.release.version, and the channel named by track, moved to the new version, in that order. A record is written only once everything it points at exists, so a failure part-way leaves no dangling reference. Calling again with the same input after such a failure finishes the release rather than refusing it.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `artifact` | `ref` → `at.happyproto.plugin.v1` | Yes | The plugin. Every blob it references must already be uploaded to the caller's repo. |
| `changelog` | `string` | No | Release notes as CommonMark. The registry writes them to the caller's repo as a site.standard.document and links it from the version. |
| `name` | `string` | Yes | The project's name, which is the record key of its software.release.project: 1 to 64 lowercase letters, digits and interior hyphens. |
| `track` | `string` | Yes | The channel to move to the new version. |
| `validateOnly` | `boolean` | No | Check the input against every rule the registry applies, and write nothing. Works without authentication, but only a signed-in call is also checked against the caller's existing records. |
| `version` | `string` | Yes | A semver version without build metadata, with an optional lowercase prerelease, such as `1.2.0` or `1.2.0-beta.1`. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `changelog` | `ref` → `at.happyproto.registry.defs#ref` | No | The changelog's site.standard.document, when a changelog was given. |
| `channel` | `ref` → `at.happyproto.registry.defs#ref` | No | The software.release.channel. Absent when validateOnly was set. |
| `manifest` | `ref` → `at.happyproto.registry.defs#ref` | No | The software.release.manifest. Absent when validateOnly was set. |
| `resumed` | `boolean` | No | True when the version already existed with this artifact, so this call only finished what an earlier one started. |
| `valid` | `boolean` | Yes | Always true; invalid input is an error, not a result. |
| `version` | `ref` → `at.happyproto.registry.defs#ref` | No | The software.release.version. Absent when validateOnly was set. |

#### Errors

- **AuthRequired**: The caller's identity could not be determined, so there is no repo to write to.
- **NotConfigured**: The registry has no identity configured. An operator problem, not a caller's.
- **InvalidRecord**: The input breaks a rule the registry applies, so it would refuse the records. The message names the field.
- **Upstream**: A record could not be written to the caller's repo. Records written before the failure stay, and the same call can be made again.
- **ProjectMissing**: The caller has no project of that name, or the registry has not indexed its at.happyproto.registry.project record. Call putProject first.
- **VersionExists**: That version is already published with a different artifact. A version never changes once published; publish a new one.
- **NotInstallable**: The project is unavailable or retired, so the channel cannot be moved to a new version.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Publish a version of a plugin to the caller's repo. Writes a software.release.manifest carrying the artifact, the changelog as a site.standard.document when one is given, the software.release.version, and the channel named by track, moved to the new version, in that order. A record is written only once everything it points at exists, so a failure part-way leaves no dangling reference. Calling again with the same input after such a failure finishes the release rather than refusing it.",
      "errors": [
        {
          "description": "The caller's identity could not be determined, so there is no repo to write to.",
          "name": "AuthRequired"
        },
        {
          "description": "The registry has no identity configured. An operator problem, not a caller's.",
          "name": "NotConfigured"
        },
        {
          "description": "The input breaks a rule the registry applies, so it would refuse the records. The message names the field.",
          "name": "InvalidRecord"
        },
        {
          "description": "A record could not be written to the caller's repo. Records written before the failure stay, and the same call can be made again.",
          "name": "Upstream"
        },
        {
          "description": "The caller has no project of that name, or the registry has not indexed its at.happyproto.registry.project record. Call putProject first.",
          "name": "ProjectMissing"
        },
        {
          "description": "That version is already published with a different artifact. A version never changes once published; publish a new one.",
          "name": "VersionExists"
        },
        {
          "description": "The project is unavailable or retired, so the channel cannot be moved to a new version.",
          "name": "NotInstallable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "artifact": {
              "description": "The plugin. Every blob it references must already be uploaded to the caller's repo.",
              "ref": "at.happyproto.plugin.v1",
              "type": "ref"
            },
            "changelog": {
              "description": "Release notes as CommonMark. The registry writes them to the caller's repo as a site.standard.document and links it from the version.",
              "maxGraphemes": 20000,
              "maxLength": 200000,
              "type": "string"
            },
            "name": {
              "description": "The project's name, which is the record key of its software.release.project: 1 to 64 lowercase letters, digits and interior hyphens.",
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            "track": {
              "description": "The channel to move to the new version.",
              "knownValues": [
                "latest",
                "beta",
                "alpha"
              ],
              "type": "string"
            },
            "validateOnly": {
              "default": false,
              "description": "Check the input against every rule the registry applies, and write nothing. Works without authentication, but only a signed-in call is also checked against the caller's existing records.",
              "type": "boolean"
            },
            "version": {
              "description": "A semver version without build metadata, with an optional lowercase prerelease, such as `1.2.0` or `1.2.0-beta.1`.",
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "name",
            "version",
            "track",
            "artifact"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "changelog": {
              "description": "The changelog's site.standard.document, when a changelog was given.",
              "ref": "at.happyproto.registry.defs#ref",
              "type": "ref"
            },
            "channel": {
              "description": "The software.release.channel. Absent when validateOnly was set.",
              "ref": "at.happyproto.registry.defs#ref",
              "type": "ref"
            },
            "manifest": {
              "description": "The software.release.manifest. Absent when validateOnly was set.",
              "ref": "at.happyproto.registry.defs#ref",
              "type": "ref"
            },
            "resumed": {
              "description": "True when the version already existed with this artifact, so this call only finished what an earlier one started.",
              "type": "boolean"
            },
            "valid": {
              "description": "Always true; invalid input is an error, not a result.",
              "type": "boolean"
            },
            "version": {
              "description": "The software.release.version. Absent when validateOnly was set.",
              "ref": "at.happyproto.registry.defs#ref",
              "type": "ref"
            }
          },
          "required": [
            "valid"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "at.happyproto.registry.publishRelease",
  "lexicon": 1
}
```
