github 获取repo 发布的版本号
Posted nickchou
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了github 获取repo 发布的版本号相关的知识,希望对你有一定的参考价值。
获取最新版本
https://api.github.com/repos/nickchou/paopao/releases/latest
获取版本列表
https://api.github.com/repos/nickchou/paopao/releases
nickhou:github账号,根据需要换成需要的
paopao:github托管的repo项目名,更换为自己想要的
http抓取数据反序列化后解析即可
案例:github获取最新版本(/releases/latest)返回的json
{
"url": "https://api.github.com/repos/nickchou/paopao/releases/12361298",
"assets_url": "https://api.github.com/repos/nickchou/paopao/releases/12361298/assets",
"upload_url": "https://uploads.github.com/repos/nickchou/paopao/releases/12361298/assets{?name,label}",
"html_url": "https://github.com/nickchou/paopao/releases/tag/v1.2",
"id": 12361298,
"node_id": "MDc6UmVsZWFzZTEyMzYxMjk4",
"tag_name": "v1.2",
"target_commitish": "master",
"name": "paopao.v1.2",
"draft": false,
"author": {
"login": "nickchou",
"id": 5896766,
"node_id": "MDQ6VXNlcjU4OTY3NjY=",
"avatar_url": "https://avatars2.githubusercontent.com/u/5896766?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nickchou",
"html_url": "https://github.com/nickchou",
"followers_url": "https://api.github.com/users/nickchou/followers",
"following_url": "https://api.github.com/users/nickchou/following{/other_user}",
"gists_url": "https://api.github.com/users/nickchou/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nickchou/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nickchou/subscriptions",
"organizations_url": "https://api.github.com/users/nickchou/orgs",
"repos_url": "https://api.github.com/users/nickchou/repos",
"events_url": "https://api.github.com/users/nickchou/events{/privacy}",
"received_events_url": "https://api.github.com/users/nickchou/received_events",
"type": "User",
"site_admin": false
},
"prerelease": false,
"created_at": "2018-08-11T14:16:10Z",
"published_at": "2018-08-11T14:19:58Z",
"assets": [
{
"url": "https://api.github.com/repos/nickchou/paopao/releases/assets/8212410",
"id": 8212410,
"node_id": "MDEyOlJlbGVhc2VBc3NldDgyMTI0MTA=",
"name": "paopao.v1.2.rar",
"label": null,
"uploader": {
"login": "nickchou",
"id": 5896766,
"node_id": "MDQ6VXNlcjU4OTY3NjY=",
"avatar_url": "https://avatars2.githubusercontent.com/u/5896766?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nickchou",
"html_url": "https://github.com/nickchou",
"followers_url": "https://api.github.com/users/nickchou/followers",
"following_url": "https://api.github.com/users/nickchou/following{/other_user}",
"gists_url": "https://api.github.com/users/nickchou/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nickchou/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nickchou/subscriptions",
"organizations_url": "https://api.github.com/users/nickchou/orgs",
"repos_url": "https://api.github.com/users/nickchou/repos",
"events_url": "https://api.github.com/users/nickchou/events{/privacy}",
"received_events_url": "https://api.github.com/users/nickchou/received_events",
"type": "User",
"site_admin": false
},
"content_type": "application/octet-stream",
"state": "uploaded",
"size": 120482,
"download_count": 3,
"created_at": "2018-08-11T14:19:42Z",
"updated_at": "2018-08-11T14:19:46Z",
"browser_download_url": "https://github.com/nickchou/paopao/releases/download/v1.2/paopao.v1.2.rar"
}
],
"tarball_url": "https://api.github.com/repos/nickchou/paopao/tarball/v1.2",
"zipball_url": "https://api.github.com/repos/nickchou/paopao/zipball/v1.2",
"body": "* 新增多线程支持
* 新增线程可暂停、终止功能
* 继续优化log4net日志格式
* 窗体resize控件自使用,虽然还是有点丑,讲究用吧
* 执行结果日期格式精简
* 文本日志去空格换行等"
}
以上是关于github 获取repo 发布的版本号的主要内容,如果未能解决你的问题,请参考以下文章
sh [Shell - 从GitHub上的存储库获取最新版本号]从GitHub上的存储库获取最新版本号,不适用不规范发布#github #shell
Oracle 数据库 - 使用UEStudio修改dmp文件版本号,解决imp命令恢复的数据库与dmp本地文件版本号不匹配导致的导入失败问题,“ORACLE error 12547”问题处理(代码片段