How to create releases in GitLab?
To create a release on the GitLab website:
- Go to your repository
- In the menu choose Repository > Tags
- Add a tag for the version of your app. For example,
v1.3.1
. - Add a message (title) about the release. For example,
Release 1.3.1
. - Add a note that describes the details of the release. (Not optional. Adding a note to a tag is what makes it a release.)
- Click Create tag.
The release will now show up under Project > Releases. Read more at the GitLab documentation. GitLab recommends that you use the Release API now, but their documentation is hard to follow. It would be the preferred method for automating everything with CI/CD, though.
If you are talking about GitHub-like release, where you associate one or several binaries to a tag, then no, GitLab doesn't include this feature yet.
You have a suggestion in progress, for which Pull Request are accepted.
Update Nov 2015: As I mentioned in "How to store releases/binaries in GitLab?", GitLab 8.2 supports releases.
With releases you can now add a Markdown-formatted message to any Git tag and attach any number of files to it.
Note: its release API does not support file attachment yet.
Keelan mentions in the comments that issue 31221 is tracking that request.
GitLab 11.7 (January 2019) adds the ability to create releases in GitLab and view them on a summary page.
Releases are a snapshot in time of the source, links, and other metadata or artifacts associated with a released version of your code, and allow for users of your project to easily discover the latest released version of your code.
GitLab 12.6 (Dec. 2019) adds "Automated Release Evidence collection to support audits"
GitLab Releases now have a new Evidence collection entry in which you can find a snapshot of the Release’s metadata in JSON format. This snapshot can be leveraged as a chain of custody to support review and compliance processes, such as audits.
See issue 26019 and documentation.
GitLab 12.10 (April 2020) allows:
Compare Release Evidence over time
(for Premium+ edition only)
GitLab 13.2 (July 2020) adds:
Create releases from
.gitlab-ci.yml
In 12.10, we introduced a way for you to automatically create release tags from the
.gitlab-ci.yml
file.
Now we’ve made it easier and more natural to use by exposing the release keyword as a step the GitLab Runner can parse. You no longer need to add a script to call the Release API to create a release.
Instead, you can simply add the correct parameters to your CI/CD file.
See documentation and issue.
GitLab 13.5 (October 2020) now has:
Attach binary assets to Releases
If you aren’t currently using GitLab for your releases because you can’t attach binaries to releases, your workflow just got a lot simpler.
You now have the ability to attach binaries to a release tag from the
gitlab.ci-yml
. This extends support of Release Assets to include binaries, rather than just asset links or source code. This makes it even easier for your development teams to adopt GitLab and use it to automate your release process.See Documentation and Issue.
With GitLab 13.7 (December 2020):
Define your release description in an external file
If you create releases in your pipelines via your project’s
.gitlab-ci.yml
file, you’ve probably found it difficult to maintain each release’s description.In GitLab 13.7, you can now define your release description in a source-controlled or auto-generated file and call it from
.gitlab-ci.yml
.
Doing so loads the file’s content into your release description as Markdown.This makes releases easier for you to create, maintain, and use with version control and is especially useful if you want to auto-generate your changelogs.
Huge thanks to Nejc Habjan and Siemens for a great community contribution!See Documentation and Issue.
See GitLab 13.10 (March 2021)
Create a release from an existing tag
Previously, creating a release was supported only for new tags. In GitLab 13.10, you can now create a release by selecting an existing tag, something that will give you more flexibility when planning releases.
See Documentation and Issue.
With GitLab 13.12 (May 2021)
release: keyword supports asset links
Since GitLab 13.2, you’ve been able to use the
release:
keyword, in conjunction with the release-cli, to create a release.The
release:
keyword has now been extended to include support for asset links so that you can create releases and attach files to them in a single.gitlab-ci.yml
release job.See Documentation and Issue.
And GitLab 15.1 (June 2022) adds:
Create annotated Tags with the GraphQL Release API
Previously, you were only able to create lightweight tags when using the GraphQL API to create a release.
With this update, you can now add an optional
tagMessage
parameter to create an annotated tag when creating a release.
This enables you to include relevant information along with the new tag, so downstream users and applications can have additional context.See Documentation and Issue.
And when creating a release with a GitLab CICD pipeline, GitLab 15.3 (August 2022) proposes:
Create annotated tags by using release:tag_message keyword
Create annotated tags by using
release:tag_message
keywordYou can now create an annotated tag when you create a release. In the
.gitlab-ci.yaml
file, use therelease
keyword to include an optionaltag_message
subkey and specify a message. This enables you to include relevant information along with the new tag, so downstream users and applications can have additional context.See Documentation and Issue.
Or, still with GitLab 15.3 (August 2022):
Create annotated tags using the Release CLI
Previously, you were only able to create lightweight tags when using the GitLab Release CLI to create a release.
With this update, you can now add an optional
tag-message
parameter to create an annotated tag when creating a release.
This enables you to include relevant information along with the new tag so downstream users and application can have additional context.See Documentation and Issue.
release-cli --server-url https://gitlab.com --job-token=SOME_JOB_TOKEN --project-id 12345 create help