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

How to snapshot a software release (with GitHub)?

This GitHub guide 似乎表明 tag-ing 发布快照已编译的二进制文件。我之前假设 tag-ing 发布旨在快照源代码状态,其中构建(或等效)目录经常被故意忽略。还是仅通过提交版本更新来执行?

我想我正在尝试了解发布需要采取哪些版本控制步骤的典型过程。到目前为止,这是我的想象:

1.

git commit -m 'Add new feature'

2.

增加您的版本号(使用 semantic versioning)并将更改添加到暂存中。

3.

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

4.

Tag the release 通过将编译后的二进制文件上传到 GitHub

中的远程存储库

5.

通过 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

没错。

"Releases" 不是原生的 Git 概念,但标签是。 GitHub 将 Git 标签用于其专有版本功能。如果您标记修订并将该标记推送到 GitHub,您的版本将是源代码版本。

但是你可以选择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.

如果您想要二进制版本,您可以通过 GitHub 网站 UI 创建您的版本,如该页面所述。

或者,您可以

  1. 在本地创建带注释的标签,

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

    git push --tags
    
  3. 通过转到 https://github.com/user/repo/tags 并单击 "Edit release notes" link.

    添加您的二进制版本。

    在这里您可以为您的版本命名和描述并上传您的二进制文件。完成此操作后,您的版本将出现在 https://github.com/user/repo/releases,下载 links 用于您的 .zip.tar.gz 格式的源代码,以及任何格式的二进制文件你上传了。