管理仓库中的发行版

您可以创建要捆绑的发行版,并将项目的迭代交付给用户。

Repository collaborators and people with write access to a repository can create, edit, and delete a release.

关于发行版管理

You can create new releases with release notes, @mentions of contributors, and links to binary files, as well as edit or delete existing releases.

您也可以在 GitHub Marketplace 中从特定的发行版发布操作。 更多信息请参阅“在 GitHub Marketplace 中发布操作”。

您可以选择是否将 Git Large File Storage (Git LFS) 对象包含在 GitHub 为每个发行版创建的 ZIP 文件和 tarball 中。 更多信息请参阅“管理仓库存档中的 Git LFS 对象”。

创建发行版

  1. 在 GitHub 上,导航到仓库的主页面。

  2. 对于文件列表的右侧,单击 Releases(发行版)Latest release(最新发行版)右侧边栏中的 Releases(发行版)部分

  3. 单击 Draft a new release(草拟新发行版)发行版草稿按钮

  4. Click Choose a tag and type a version number for your release. Alternatively, select an existing tag.

    Enter a tag

  5. If you are creating a new tag, click Create new tag. Confirm you want to create a new tag

  6. If you have created a new tag, use the drop-down menu to select the branch that contains the project you want to release. Choose a branch

  7. 键入发行版的标题和说明。 If you @mention any GitHub users in the description, the published release will include a Contributors section with an avatar list of all the mentioned users. Alternatively, you can automatically generate your release notes by clicking Auto-generate release notes.

    发行版说明

  8. (可选)要在发行版中包含二进制文件(例如已编译的程序),请在二进制文件框中拖放或手动选择文件。 通过发行版提供 DMG

  9. 要通知用户发行版本尚不可用于生产,可能不稳定,请选择 This is a pre-release(这是预发布)将版本标记为预发行版的复选框

  10. (可选)选择 Create a discussion for this release(为此版本创建讨论),然后选择 Category(类别)下拉菜单,然后点击类别进行版本讨论。 用于创建发行版讨论和下拉菜单以选择类别的复选框

  11. 如果您准备推广您的发行版,请单击 Publish release(发布版本)。 要在以后处理该发行版,请单击 Save draft(保存草稿)发布版本和草拟发行版按钮 You can then view your published or draft releases in the releases feed for your repository. For more information, see "Viewing your repository's releases and tags."

    Published release with @mentioned contributors

To learn more about GitHub CLI, see "About GitHub CLI."

  1. To create a release, use the gh release create subcommand. Replace tag with the desired tag for the release.

    gh release create tag
  2. Follow the interactive prompts. Alternatively, you can specify arguments to skip these prompts. For more information about possible arguments, see the GitHub CLI manual. For example, this command creates a prerelease with the specified title and notes.

    gh release create v1.3.2 --title "v1.3.2 (beta)" --notes "this is a beta release" --prerelease

If you @mention any GitHub users in the notes, the published release on GitHub.com will include a Contributors section with an avatar list of all the mentioned users.

编辑发行版

  1. 在 GitHub 上,导航到仓库的主页面。
  2. 对于文件列表的右侧,单击 Releases(发行版)Latest release(最新发行版)右侧边栏中的 Releases(发行版)部分
  3. 在页面右侧要编辑的发行版旁边,单击 Edit release(编辑发行版)编辑发行版
  4. Edit the details for the release in the form, then click Update release. If you add or remove any @mentions of GitHub users in the description, those users will be added or removed from the avatar list in the Contributors section of the release. 更新发行版

Releases cannot currently be edited with GitHub CLI.

删除发行版

  1. 在 GitHub 上,导航到仓库的主页面。
  2. 对于文件列表的右侧,单击 Releases(发行版)Latest release(最新发行版)右侧边栏中的 Releases(发行版)部分
  3. 单击要删除的发行版的名称。 用于查看发行版的链接
  4. 在页面右上角,单击 Delete(删除)删除发行版按钮
  5. 单击 Delete this release(删除此发行版)确认删除发行版
  1. To delete a release, use the gh release delete subcommand. Replace tag with the tag of the release to delete. Use the -y flag to skip confirmation.

    gh release delete tag -y

此文档对您有帮助吗?

隐私政策

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。