简体   繁体   English

GitHub 中的 Release 到底是什么?

[英]What exactly is a Release in GitHub?

  • What is it exactly?究竟是什么?
  • For what is it used?它是用来做什么的?
  • How widespread is the usage?使用范围有多广?
  • How is it usually used?它通常是如何使用的?

From Official GitHub :来自官方 GitHub

Releases are GitHub's way of packaging and providing software to your users.发布GitHub 为您的用户打包和提供软件的方式。 You can think of it as a replacement to using downloads to provide software.您可以将其视为使用下载来提供软件的替代品。

With Releases , you can provide links to binary files, as well as release notes describing your changes.使用Releases ,您可以提供二进制文件的链接,以及描述您的更改的发行说明。

At their core, Releases are based on Git tags .发布的核心是基于Git 标签 Tags mark a specific point in the history of your project, so they're a great way to indicate a Release.标签标记项目历史中的特定点,因此它们是指示发布的好方法。 Releases are ordered by a tag's date in the following way:发布按标签的日期按以下方式排序:

For more information about viewing your existing tags, see Working With Tags .有关查看现有标签的更多信息,请参阅使用标签

I would like to backup this official explanation from people who are already using that to see how it works.我想从已经使用它的人那里备份这个官方解释,看看它是如何工作的。

Definition定义

As mentioned in " About Releases "如“关于版本”中所述

Releases are GitHub's way of packaging and providing software to your users.发布是 GitHub 为您的用户打包和提供软件的方式。 You can think of it as a replacement to using downloads to provide software.您可以将其视为使用下载来提供软件的替代品。

A release is a container of one or more assets, associated to a git annotated tag (since git push --follow-tags only pushes annotated tags )发布是一个或多个资产的容器,与 git 注释标签相关联(因为git push --follow-tags仅推送注释标签

It replaces since July 2013 an old "GitHub Download" system which was beginning to get abused (people stored anything and everything in it), and removed in Dec. 2012.它取代了自 2013 年 7 月以来开始被滥用的旧“GitHub 下载”系统(人们在其中存储了任何东西),并于 2012 年 12 月被删除。
By forcing an indirection (tag => release => asset), GitHub made that feature more manageable.通过强制间接(标签 => 发布 => 资产),GitHub 使该功能更易于管理。

dirkjot adds in the comments : dirkjot 在评论中补充道:

Two great points that are easily overlooked:两个很容易被忽视的要点:

  1. A release is initially "empty" because it is associated with a tag, not generated from that tag发布最初是“空的”,因为它与标签相关联,而不是从该标签生成
  2. Assets are uploaded so not necessarily related to the source code.资产已上传,因此不一定与源代码相关。

Footnote: An empty release will automatically contain a tgz and zip version of the source at the tagged commit脚注:空版本将在标记提交处自动包含源代码的 tgz 和 zip 版本


Usage用法

A GitHub release is used:使用 GitHub 版本:

  • to avoid storing large generated binaries built from project in a source control system like git.避免将项目生成的大型二进制文件存储在 git 等源代码控制系统中。
  • by users of a repo to download the "end result", ie the "delivery" already built for them from a git repo content, even if they don't have git.由 repo 的用户下载“最终结果”,即已经从 git repo 内容为他们构建的“交付”,即使他们没有 git。

Example例子

An example of a project using releases would be git for windows releases .使用版本的项目示例是git for windows 版本
In the case of git for Windows , that comes in handy considering that you might want to install git in the first place, and you might not have the right tool-set to compile its sources.git for Windows的情况下,考虑到您可能希望首先安装 git,并且您可能没有正确的工具集来编译其源代码,这会派上用场。


API consideration API 考虑

As the GitHub V3 Release API illustrates, a release is not a tag.正如GitHub V3 发布 API所示,发布不是标签。
When you create a release , you would need the name of a tag, but that would create an empty release (associated to that tag) 创建发布时,您需要标签的名称,但这会创建一个发布(与该标签相关联)

From a release, you can upload one or more assets to it .从发布中,您可以将一个或多个资产上传到它

The asset data is expected in its raw binary form.资产数据预计为原始二进制形式。

POST https://<upload_url>/repos/:owner/:repo/releases/:id/assets?name=foo.zip

Note: GitLab also supports "release" since GitLab 8.2 (Nov. 2015) .注意:GitLab从 GitLab 8.2(2015 年 11 月)开始也支持“发布”。


Discussion讨论

Since Apr. 2021, you now have:自 2021 年 4 月起,您现在拥有:

Releases support comments and reactions with Discussion linking 通过讨论链接发布支持评论和反应

You can now link discussions to new releases!您现在可以将讨论链接到新版本!

When drafting a new release, check the Create a discussion for this release box, choose a category, and publish.在起草新版本时,选中为此版本创建讨论框,选择一个类别,然后发布。
Your community will be able to react and comment on the release notes, giving projects more opportunities to celebrate and receive feedback.您的社区将能够对发行说明做出反应和评论,从而为项目提供更多庆祝和接收反馈的机会。
Release discussions are also available natively on GitHub Mobile.发布讨论也可以在 GitHub Mobile 上本地获得。

在发布时启用讨论创建 -- https://i1.wp.com/user-images.githubusercontent.com/1923260/113341794-76e64a00-92e2-11eb-9d35-3f843d0a313c.png?w=1208&ssl=1

For more information, see GitHub Discussions , GitHub Releases and GitHub Mobile documentation.有关更多信息,请参阅GitHub 讨论GitHub 发布GitHub 移动文档。


Note that in Q3 2021, you could have a native changelog generator .请注意,在 2021 年第 3 季度,您可以拥有一个本机变更日志生成器


And from June 2022, you can set/change/modify a release notes for a previous release (or past release):从 2022 年 6 月起,您可以设置/更改/修改以前版本(或过去版本)的发行说明:

You can now manually select a previous release when generating release notes您现在可以在生成发行说明时手动选择以前的版本

It is now possible to manually select the previous release prior to generating release notes in the GitHub Releases UI.现在可以在 GitHub Releases UI 中生成发行说明之前手动选择以前的版本。

For more information on Generating Release Notes, see the Automatically Generated Release Notes documentation .有关生成发行说明的更多信息,请参阅自动生成的发行说明文档 For more information on GitHub Releases, see the GitHub Releases documentation .有关 GitHub 版本的更多信息,请参阅GitHub 版本文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM