Release¶
Releases publish versions based on tags and can carry attachments. The API lets you create, update, query, and delete releases, get the latest release, obtain attachment upload URLs, and download or delete attachments.
Objects¶
| Object | Description | Related endpoints |
|---|---|---|
| Release | Tag name, title, description, prerelease flag, attachment list | Get all repository releases |
| Attachment | Upload URL, download, and deletion for a release | Get the release attachment upload URL |
Identification¶
- A repository is identified by
owner+repo, and a release bytag(for most endpoints the path parameter is the tag name). - Attachment download uses
file_name, while deletion usesattach_file_id; these are not the same identifier. - The path for the latest release uses the
*placeholder.
Common tasks¶
| Task | Endpoint |
|---|---|
| List all releases | GET /api/v5/repos/{owner}/{repo}/releases |
| Get a single release | GET /api/v5/repos/{owner}/{repo}/releases/{tag} |
| Create a release | POST /api/v5/repos/{owner}/{repo}/releases |
| Update a release | PATCH /api/v5/repos/{owner}/{repo}/releases/{tag} |
| Get the latest release | GET /api/v5/repos/*/*/releases/latest |
| Get by tag name | GET /api/v5/repos/{owner}/{repo}/releases/tags/{tag} |
| Get the attachment upload URL | GET /api/v5/repos/{owner}/{repo}/releases/{tag}/upload_url |
| Download an attachment | GET /api/v5/repos/{owner}/{repo}/releases/{tag}/attach_files/{file_name}/download |
| Delete an attachment | DELETE /api/v5/repos/{owner}/{repo}/releases/{tag}/attach_files/{attach_file_id} |
Notes¶
- There are two paths for getting a release by tag:
GET …/releases/{tag}andGET …/releases/tags/{tag}; the latter is for cases where the tag name conflicts with the path. - The path for the latest release is
GET /api/v5/repos/*/*/releases/latest, which uses*placeholders instead of{owner}/{repo}. - Uploading an attachment means "first get the upload_url, then upload to the returned address"; it is not a POST directly to the releases endpoint.
- Attachment download uses the file name
file_name, while deletion uses the attachment IDattach_file_id; the parameters of the two endpoints are not interchangeable. - A release depends on a tag: create the tag first, then publish the release. Adding and deleting tags is covered in the Tag group.
Endpoint list¶
This module contains 9 endpoints.
| # | Endpoint | Method and path | Description |
|---|---|---|---|
| 1 | Create a repository release | POST /api/v5/repos/{owner}/{repo}/releases |
Creates a repository release. |
| 2 | Update a repository release | PATCH /api/v5/repos/{owner}/{repo}/releases/{tag} |
Updates a repository release. |
| 3 | Get the release attachment upload URL | GET /api/v5/repos/{owner}/{repo}/releases/{tag}/upload_url |
Gets the upload URL for a release attachment. |
| 4 | Get a single release of the repository | GET /api/v5/repos/{owner}/{repo}/releases/{tag} |
Gets a single release of the repository. |
| 5 | Get the latest release of the repository | GET /api/v5/repos/*/*/releases/latest |
Gets the latest release of the repository. |
| 6 | Get a repository release by tag name | GET /api/v5/repos/{owner}/{repo}/releases/tags/{tag} |
Queries a repository release by tag name. |
| 7 | Get all repository releases | GET /api/v5/repos/{owner}/{repo}/releases |
Gets all releases of the repository. |
| 8 | Download a repository release attachment | GET /api/v5/repos/{owner}/{repo}/releases/{tag}/attach_files/{file_name}/download |
Downloads a repository release attachment. |
| 9 | Delete a release attachment | DELETE /api/v5/repos/{owner}/{repo}/releases/{tag}/attach_files/{attach_file_id} |
Deletes a release attachment. |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc