关于发行版管理
可以使用发行说明、@mentions 参与者和指向二进制文件的链接创建新版本,以及编辑或删除现有发行版。 还可以使用“发布 API”创建、修改和删除发行版。 有关详细信息,请参阅 REST API 文档中的“发行版本”。
创建发行版
- 在 你的企业 上,导航到存储库的主页。 1. 在文件列表右侧,单击“发布”。
1. At the top of the page, click Draft a new release. - To chose a tag for the release, select the Choose a tag dropdown menu.
- To use an existing tag, click the tag.
- To create a new tag, type a version number for your release, then click Create new tag.
- If you created a new tag, select the Target dropdown menu, then click the branch that contains the project you want to release.
- (可选)在说明文本框右上角,选择“上一个标记”下拉菜单,然后单击标识上一版本的标记。
1. In the "Release title" field, type a title for your release. - 在“描述此版本”字段中,键入此版本的说明。
如果在描述中 @mention 任何用户,发布的版本将包含“参与者”部分以及所有被提及用户的头像列表。
- Optionally, to include binary files such as compiled programs in your release, drag and drop or manually select files in the binaries box.
- Optionally, to notify users that the release is not ready for production and may be unstable, select This is a pre-release.
- If you're ready to publicize your release, click Publish release. To work on the release later, click Save draft. You can then view your published or draft releases in the releases feed for your repository. For more information, see "查看仓库的发行版和标记."
若要详细了解 GitHub CLI,请参阅“关于 GitHub CLI”。
-
若要创建发行版,请使用
gh release create
子命令。 将tag
替换为发行版所需的标记。gh release create TAG
-
按照交互式提示进行操作。 或者,您可以指定参数以跳过这些提示。 有关可能的参数的详细信息,请参阅 GitHub CLI 手册。 例如,此命令将创建具有指定标题和注释的预发行版。
gh release create v1.3.2 --title "v1.3.2 (beta)" --notes "this is a beta release" --prerelease
如果 @mention 注释中任何 GitHub AE 用户,则 GitHub.com 上发布的发行版将包含“参与者”部分以及所有被提及用户的头像列表。
编辑发行版
-
在 你的企业 上,导航到存储库的主页。 1. 在文件列表右侧,单击“发布”。
-
Next to the release you want to edit, click .
-
编辑窗体中的版本详细信息,然后单击“更新版本”。 如果你在描述中添加或删除任何 @mentions 的 GitHub 用户,这些用户将被添加到版本的“参与者”部分的头像列表中或从中删除。
当前无法使用 GitHub CLI 编辑版本。
删除发行版
-
在 你的企业 上,导航到存储库的主页。 1. 在文件列表右侧,单击“发布”。
-
在页面右侧要删除的版本旁边,单击“”。
-
单击“删除此发行版”。
-
若要删除发行版,请使用
gh release delete
子命令。 将tag
替换为要删除的发行版标记。 使用-y
标志跳过确认。gh release delete TAG -y