简体   繁体   English

如何对软件版本进行快照(使用GitHub)?

[英]How to snapshot a software release (with GitHub)?

This GitHub guide seems to indicate that tag -ing a release snapshots a compiled binary. 这个GitHub指南似乎表明tag发布快照编译的二进制文件。 I was previously under the assumption that tag -ing a release is intended to snapshot the source code state, where the build (or equivalent) directories are often intentionally ignored. 我以前假设tag发布版本旨在对源代码状态进行快照,其中构建(或等效)目录经常被故意忽略。 Or is that just performed by a commit of only a version update? 或者只是通过提交版本更新来执行?

I guess I'm trying to understand a typical process for what version control steps need to be taken for a release. 我想我正在尝试理解一个典型的过程,需要为发布版本采取哪些版本控制步骤。 Here is what I'm imagining so far: 这是我到目前为止所想象的:

1. 1。

git commit -m 'Add new feature'

2. 2。

Bump your version number (using semantic versioning ) and add the change to staging. 压缩您的版本号(使用语义版本控制 )并将更改添加到暂存。

3. 3。

git commit -m 'Bump version to X.Y.Z'

4. 4。

Tag the release by uploading the compiled binary to your remote repository in GitHub 通过将已编译的二进制文件上载到GitHub中的远程存储库来标记该版本

5. 5。

Via GitHub client, sync on your local machine to pull down the update (tag) performed on GitHub. 通过GitHub客户端,在本地计算机上同步以下拉在GitHub上执行的更新(标记)。

I was previously under the assumption that tag-ing a release is intended to snapshot the source code state, where the build (or equivalent) directories are often intentionally ignored 我以前假设标记版本是为了对源代码状态进行快照,其中构建(或等效)目录经常被故意忽略

That is correct. 那是对的。

"Releases" aren't a native Git concept, but tags are. “发布”不是本机Git概念,但标签是。 GitHub uses Git tags for its proprietary releases feature. GitHub使用Git标签作为其专有版本功能。 If you tag revision and push that tag to GitHub, your release will be a source release. 如果您标记修订版并将该标记推送到GitHub,那么您的版本将是源版本。

But you can optionally add a binary to a release : 但您可以选择将二进制文件添加到版本中

If you'd like to include binary files along with your release, such as compiled programs, drag and drop or select files manually in the binaries box. 如果您希望包含二进制文件以及您的发行版(例如已编译的程序),请在二进制文件框中手动拖放或选择文件。

If you want to have binary releases, you can create your release through the GitHub web UI as described in that page. 如果您想要二进制版本,可以通过GitHub Web UI创建您的版本,如该页面所述。

Alternatively, you can 或者,你可以

  1. create an annotated tag locally, 在本地创建一个带注释的标签,

     git tag -a v1.0 
  2. push that tag to GitHub, and 将该标签推送到GitHub,然后

     git push --tags 
  3. add your binary release to it, by going to https://github.com/user/repo/tags and clicking the "Edit release notes" link. 通过访问https://github.com/user/repo/tags并单击“编辑发行说明”链接,将二进制版本添加到其中。

    Here you will be able to give your release a name and description and upload your binary files. 在这里,您将能够为您的版本提供名称和描述,并上传您的二进制文件。 Once this is done, your release will appear at https://github.com/user/repo/releases , with a download links for your source in .zip and .tar.gz formats, as well as your binaries in whatever formats you uploaded. 完成此操作后,您的版本将显示在https://github.com/user/repo/releases上 ,其中包含.zip.tar.gz格式的源代码下载链接,以及您的任何格式的二进制文件上传。

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

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