Use `.gitlab-ci.yml` for Release generation
### Problem to solve
Now that we have a releases page (https://gitlab.com/gitlab-org/gitlab-ce/issues/41766), there should be a straightforward way to create a release from the `.gitlab-ci.yml` without making curls to the [Releases API](https://docs.gitlab.com/ee/api/releases/index.html).
### Target audience
Automation engineers who are working on releases and want a native way to add releases without using `script:` elements to curl an API
### Further details
This is good polish for the releases feature in that it makes the integration feel better integrated into the product. Also, this provides better overall experience once features like https://gitlab.com/gitlab-org/gitlab-ce/issues/56023 are implemented.
### Proposal
Introduce a new job syntax that can create a release automatically using `POST /projects/:id/releases` behind the scenes:
```yaml
stages:
- build
- test
- release
release:
stage: release
only: tags
script:
- make changelog | tee release_changelog.txt
release:
name: Release $CI_TAG_NAME
description: ./release_changelog.txt
assets:
links:
- name: cool-app.zip
url: http://my.awesome.download.site/1.0-$CI_COMMIT_SHORT_SHA.zip
- name: cool-app.exe
url: http://my.awesome.download.site/1.0-$CI_COMMIT_SHORT_SHA.exe
```
- `release` indicates that the job produces release asset(s). It is active only if git reference is tag
- `release:name` specifies the release name. If it's not created yet, then create a new entry.
- `release:description` specifies a file containing the description of the release (can point to changelog)
These keys will be built in this iteration and exposed via the API. Assets will be supported in a follow-up issue https://gitlab.com/gitlab-org/gitlab/issues/36133
- `release:assets` adds assets to the release.
- `release:assets:links` an array of link-type assets
- `release:assets:links:name` (optional) specifies the asset name. This will be used when downloading the asset if provided.
- `release:assets:links:url` specified the link of an asset.
epic