git:release
About 528 wordsAbout 2 min
git:release
Publish a Release for the repository
Applicable Events
pushcommit.addbranch.createtag_pushpull_request.mergedapi_triggerweb_triggertag_deploy
Parameters
The list below gives an overview of all git:release parameters.
- overlying: Overlay mode:
trueonly edits/updates,falsedeletes then recreates - tag: Tag name for the release; not needed on
tag_push - title: Release title; defaults to the tag name
- description: Release description
- descriptionFromFile: Read description content from a local file
- preRelease: Whether to mark the release as a pre-release
- latest: Whether to set the release as the latest
Detailed descriptions for each parameter are provided below.
Tips
This built-in task does not support uploading attachments. You can use the cnbcool/attachments task to upload attachments.
overlying
- type:
Boolean - required:
false - default:
false
Overlay mode:
true: Overlay mode, meaning this is only for editing or updating the Release.false: Non-overlay mode, meaning delete first, then recreate the Release.
Warning
Default is false, meaning that when a Release version already exists, it will be deleted first and then recreated.
tag
- type:
String|Number - required:
false
Tag name corresponding to the release, not required.
For tag_push events, this is not needed as it directly takes the Tag name triggering the tag_push event.
For non-tag_push events, this is required as the Tag name corresponding to the Release.
title
- type:
String|Number - required:
false - default: Tag name
Title of the Release.
description
- type:
String - required:
false
Description of the Release. When the content is too large, it is recommended to use the descriptionFromFile parameter to pass the content through a file to avoid exceeding limits.
Warning
description and descriptionFromFile are mutually exclusive and cannot be specified at the same time.
descriptionFromFile
- type:
String - required:
false
Read content from a file and use it as the description of the Release.
Specify a local file path, and the system will read the file content and use it as the description of the Release.
Warning
description and descriptionFromFile are mutually exclusive and cannot be specified at the same time.
preRelease
- type:
Boolean - required:
false - default:
false
Whether to set the release as a pre-release.
latest
- type: "true" | "false" | true | false
- required:
false - default:
false
Whether to set the Release as the latest version.
Output Results
None
Configuration Examples
- Generate changelog and automatically update Release description:
$:
tag_push:
- stages:
- name: Changelog
image: cnbcool/changelog
settings:
latestChangeLogTarget: LATEST_CHANGELOG.md
- name: Upload Release
type: git:release
options:
title: release
descriptionFromFile: LATEST_CHANGELOG.md- Publish a Release when pushing to the main branch:
main:
push:
- stages:
- name: Git Release
type: git:release
options:
tag: Nightly
description: description