Skip to content

feat: add new `release` commands to manage GitLab releases

Clement Sam requested to merge feat-release-create into trunk

New commands:

  • glab release create <tag> [<files>...]
  • glab release upload <tag> <files>...
  • glab release view <tag>
  • glab release download <tag> [<pattern>]
  • glab release delete <tag>

Example output:

image

Example help:

$ glab release create -h

Create a new or update a GitLab Release for a repository.

If the release already exists, glab updates the release with the new info provided.

If a git tag specified does not yet exist, the release will automatically get created
from the latest state of the default branch and tagged with the specified tag name.
Use `--ref` to override this.
The `ref` can be a commit SHA, another tag name, or a branch name.
To fetch the new tag locally after the release, do `git fetch --tags origin`.

To create a release from an annotated git tag, first create one locally with
git, push the tag to GitLab, then run this command.

NB: Developer level access to the project is required to create a release.

USAGE
  glab release create <tag> [<files>...] [flags]

FLAGS
  -a, --assets JSON         JSON string representation of assets links (e.g. `--assets='[{"name": "Asset1", "url":"https://<domain>/some/location/1", "link_type": "other", "filepath": "path/to/file"}]')`
  -m, --milestone strings   The title of each milestone the release is associated with
  -n, --name string         The release name or title
  -N, --notes string        The release notes/description. You can use Markdown
  -F, --notes-file file     Read release notes file. Specify `-` as value to read from stdin
  -r, --ref string          If a tag specified 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 date    The date when the release is/was ready. Defaults to the current datetime. Expected in ISO 8601 format (2019-03-15T08:00:00Z)

TODO:

  • view: add metadata to rendered output
  • view: add ability to view latest release for a repository
  • create: add flags for metadata
  • create: enable interactive flow
  • create: accept a list of files for upload
  • create: offer options to pre-populate release notes
    • Use commit messages as a template
    • Use merge request titles as a template
    • Use annotated git tag as template
  • glab release upload command
  • glab release download command
  • glab release delete command

Fixes #366 (closed)

Merge request reports