Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于自动更新以及版本号 #45

Closed
niuhuan opened this issue Oct 20, 2021 · 10 comments
Closed

关于自动更新以及版本号 #45

niuhuan opened this issue Oct 20, 2021 · 10 comments

Comments

@niuhuan
Copy link
Owner

niuhuan commented Oct 20, 2021

我希望这个版本

我期望将版本号将放到 /lib/assets 里
{
nightyVersion: "",
stableVersion: "",
content: '',
}

启动程序的时候进行校验 读取仓库的本地的版本进行校验, 如果更高则提示更新。
我期望更友好一点,考虑到手机和电脑都能使用。

或者有没有办法读取releases

@zhongfly
@Z-fly

@zhongfly
Copy link

不清楚别的app怎么实现的,但是release可以读github提供的xml https://github.com/niuhuan/pikapi-flutter/releases.atom
另外github的api应该也有这方面的

@zhongfly
Copy link

zhongfly commented Oct 20, 2021

@Z-fly
Copy link

Z-fly commented Oct 20, 2021

github在大陆基本接近彻底封杀
建议使用代理 https://ghproxy.com/

@zhongfly
Copy link

github在大陆基本接近彻底封杀 建议使用代理 https://ghproxy.com/

连github都打不开的也更新不了,不必管

@Z-fly
Copy link

Z-fly commented Oct 20, 2021

如果站在产品经理的角度看,应该是尽量满足大众的需求,**本身不挂代理也能看(换句话说大部分人也没有代理),通过代理地址更新软件也没有增加开发难度

@zhongfly
Copy link

zhongfly commented Oct 20, 2021

如果站在产品经理的角度看,应该是尽量满足大众的需求,**本身不挂代理也能看(换句话说大部分人也没有代理),通过代理地址更新软件也没有增加开发难度

你给出的网站并不能反代github的rest api(api.github.com),只是文件的反代罢了

@Z-fly
Copy link

Z-fly commented Oct 20, 2021

那你有什么好办法吗?

@zhongfly
Copy link

zhongfly commented Oct 20, 2021

那你有什么好办法吗?

本来这个项目就一直只在github分发,若是要简单的获取版本信息(本issue的重点也只是如何获取版本号,不涉及分发),配合release分发的情况下使用github的api是最佳选择之一,获取到的版本号是跟随release实时变化的。

次一级的方法是手动添加一个版本信息文件在仓库中,检查更新时下载它、读取,但问题在于需要每次都手动更新版本号,十分麻烦。
次一级的自动化方法是考虑利用github action,在每次版本发布时(github action可被tag或者commit触发),更新仓库中的版本信息文件。

综上,最简单的方法的确就是我之前提出通过github rest api获取版本信息最简单,最省事。

@niuhuan
Copy link
Owner Author

niuhuan commented Oct 20, 2021

就算从release获取,当前的apk也需要知道自己的版本号,似乎都需要手动

@zhongfly
Copy link

zhongfly commented Oct 20, 2021

就算从release获取,当前的apk也需要知道自己的版本号,似乎都需要手动

像android项目,一般是写在build.gradle里,但是检查版本号一般不会用这个文件,因为不方便读取。

你目前这个项目我不了解一般是在何处记录版本号
不是写在 https://github.com/niuhuan/pikapi-flutter/blob/master/pubspec.yaml#L18 里吗?
我目前从apk里得到的版本号就是这个(android和ios打包里版本号是必须的,所以项目里其实已经有版本号了),你可能需要考虑的是桌面端如何获得此处的版本号,是不是有对应的包可以做?这部分你是开发者啊,应该最了解啊,https://pub.dev/packages/package_info_plus 这个不知道是不是。
如果你写在方便解析的文件里可以考虑直接读取。

我的想法是,版本号是和git上的tag名称相同,更新版本时,改版本号,打tag,然后根据tag历史就可以知道版本历史。
正式版与测试版通过release与pre-release区分

@niuhuan niuhuan closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants