Releases#

Project releases#

Reference#

Examples#

Get a list of releases from a project:

project = gl.projects.get(project_id, lazy=True)
release = project.releases.list()

Get a single release:

release = project.releases.get('v1.2.3')

Edit a release:

release.name = "Demo Release"
release.description = "release notes go here"
release.save()

Create a release for a project tag:

release = project.releases.create({'name':'Demo Release', 'tag_name':'v1.2.3', 'description':'release notes go here'})

Delete a release:

# via its tag name from project attributes
release = project.releases.delete('v1.2.3')

# delete object directly
release.delete()

Note

The Releases API is one of the few working with CI_JOB_TOKEN, but the project can’t be fetched with the token. Thus use lazy for the project as in the above example.

Also be aware that most of the capabilities of the endpoint were not accessible with CI_JOB_TOKEN until Gitlab version 14.5.