1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
<!--
This documentation is auto generated by a script.
Please do not edit this file directly. Run `make gen-docs` instead.
-->
# `glab release create`
Create a new GitLab release, or update an existing one.
## Synopsis
Create a new release, or update an existing GitLab release, for a repository. Requires the Developer role or higher.
An existing release is updated with the new information you provide.
To create a release from an annotated Git tag, first create one locally with
Git, push the tag to GitLab, then run this command.
If the Git tag you specify doesn't exist, the release is created
from the latest state of the default branch, and tagged with the tag name you specify.
To override this behavior, use `--ref`. The `ref` can be a commit SHA, another tag name, or a branch name.
To fetch the new tag locally after the release, run `git fetch --tags origin`.
```plaintext
glab release create <tag> [<files>...] [flags]
```
## Examples
```plaintext
# Create a release interactively
$ glab release create v1.0.1
# Create a release non-interactively by specifying a note
$ glab release create v1.0.1 --notes "bugfix release"
# Use release notes from a file
$ glab release create v1.0.1 -F changelog.md
# Upload a release asset with a display name (type will default to 'other')
$ glab release create v1.0.1 '/path/to/asset.zip#My display label'
# Upload a release asset with a display name and type
$ glab release create v1.0.1 '/path/to/asset.png#My display label#image'
# Upload all assets in a specified folder (types default to 'other')
$ glab release create v1.0.1 ./dist/*
# Upload all tarballs in a specified folder (types default to 'other')
$ glab release create v1.0.1 ./dist/*.tar.gz
# Create a release with assets specified as JSON object
$ glab release create v1.0.1 --assets-links='
[
{
"name": "Asset1",
"url":"https://<domain>/some/location/1",
"link_type": "other",
"direct_asset_path": "path/to/file"
}
]'
# [EXPERIMENTAL] Create a release and publish it to the GitLab CI/CD catalog
# Requires the feature flag `ci_release_cli_catalog_publish_option` to be enabled
# for this project in your GitLab instance. Do NOT run this manually. Use it as part
# of a CI/CD pipeline with the "release" keyword:
#
# - The API endpoint accepts only "CI_JOB_TOKEN" as the authentication token.
# - It retrieves components from the current repository by searching for
# `yml` files within the "templates" directory and its subdirectories.
# - It fails if the feature flag `ci_release_cli_catalog_publish_option`
# is not enabled for this project in your GitLab instance.
# Components can be defined:
# - In single files ending in `.yml` for each component, like `templates/secret-detection.yml`.
# - In subdirectories containing `template.yml` files as entry points,
# for components that bundle together multiple related files. For example,
# `templates/secret-detection/template.yml`.
$ glab release create v1.0.1 --publish-to-catalog
```
## Options
```plaintext
-a, --assets-links --assets-links='[{"name": "Asset1", "url":"https://<domain>/some/location/1", "link_type": "other", "direct_asset_path": "path/to/file"}]'. 'JSON' string representation of assets links, like --assets-links='[{"name": "Asset1", "url":"https://<domain>/some/location/1", "link_type": "other", "direct_asset_path": "path/to/file"}]'.
-m, --milestone strings The title of each milestone the release is associated with.
-n, --name string The release name or title.
--no-close-milestone Prevent closing milestones after creating the release.
--no-update Prevent updating the existing release.
-N, --notes string The release notes or description. You can use Markdown.
-F, --notes-file string Read release notes 'file'. Specify '-' as the value to read from stdin.
--publish-to-catalog [EXPERIMENTAL] Publish the release to the GitLab CI/CD catalog.
-r, --ref string If the specified tag doesn't exist, the release is created from ref and tagged with the specified tag name. It can be a commit SHA, another tag name, or a branch name.
-D, --released-at string The 'date' when the release was ready. Defaults to the current datetime. Expects ISO 8601 format (2019-03-15T08:00:00Z).
-T, --tag-message string Message to use if creating a new annotated tag.
```
## Options inherited from parent commands
```plaintext
--help Show help for this command.
-R, --repo OWNER/REPO Select another repository. Can use either OWNER/REPO or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.
```
|