我可以从私有github仓库公开发布吗?
问题描述:
我有一个位于私人github存储库中的应用程序,我想知道是否可以将这些版本发布为公开版本,以便该应用程序可以从github自动更新自身,而不必由我们托管.
I have an application which is in a private github repo, and am wondering if the releases could be made public so that the app can auto-update itself from github instead of us having to host it.
此外,我想知道是否可以使用已部署应用程序中的github API来检查新更新.
Additionally I'm wondering if it's possible to use the github api from the deployed app to check for new updates.
答
一种解决方法是创建一个公共存储库,该存储库由以下内容组成:
A workaround would be to create a public repo, composed of:
- 空提交(
git commit --allow-empty
) - 每个提交都被标记
- 每个带有发布版本的标签
- 每个版本都有交付内容(您的私人应用的二进制文件)
- empty commits (
git commit --allow-empty
) - each commit tagged
- each tag with a release
- each release with the deliveries (the binaries of your private app)
这样,您就有一个专用于版本托管的可见存储库,以及一个用于源代码开发的专用存储库.
That way, you have a visible repo dedicated for release hosting, and a private repos for source development.