github上基于milestone自动生成releaseNotes

背景

  最近在做一个项目,代码都已经托管到github上,准备走开源路线。 项目: 一个重大轮子: 基于mysql数据库binlog的增量订阅&消费 

  使用了github的issue tracker代码,本文记录一下如何使用github管理release notes,希望能给大家玩github的有所帮助。

 

过程

步骤1 (准备issue/milestone素材)

  首先,需要先学会github issue/milestone的使用. 要做release notes,也得有最基本的issue素材。

  github issue基本介绍:https://github.com/blog/831-issues-2-0-the-next-generation

 

  1.  创建milestone 

  2. 创建issue(选择一个milestone)


 

这样基本上release相关的素材就已经准备完毕了.  

 

步骤2 (准备github pages)


1.What are GitHub Pages?  
2.GitHub Pages are public webpages freely hosted and easily published through our site. You can publish online using the Automatic Page Generator. If you prefer to work locally you can use the GitHub for Mac and Windows apps, or the command line.  

github pages介绍:

创建pages,我选择比较简单的,基于github automic generator,文档: https://help.github.com/articles/creating-pages-with-the-automatic-generator

 

进入自己工程的settings页面,点击Automatic Page Generator按钮,按照提示一步步下去即可,最后点击Publish,即发布完成.  


 自动生成后的链接地址为: username.github.com/reponame or orgname.github.com/reponame

 

步骤3 (准备release notes生成脚本)

1 下载之前生成的Git Pages,选择gh-pages分支


1.git clone git@github.com:xxxx.git -b gh-pages  


2. 下载开源的releasenotes plugin:


1.git clone https://github.com/posabsolute/releasenotes.git  


3. 合并


1.cp -R releasenotes/css releasenotes/js releasenotes/images gh-pages/  
2.cp releasenotes/index.html gh-pages/release.html  


4.  修改release.html相关参数


1.$(document).ready(function() {  
2.            $("#releaseNotesContainer").releaseNotes({  
3.                milestonesShown         : 10,  
4.                // If you want to show private repo  
5.                // You need to add repo credentials in api.php  
6.                phpApi          : false,  
7.                phpApiPath      : '/',  
8.                showDescription             : true,  
9.                showComments            : true,  
10.                // Used if phpAPI is false  
11.                    repo                            : 'canal',  //改成己的repo name  
12.                    username                : 'otter-projects'  //改成自己的username或者orgname  
13.            });  
14.        });  

5. 收工,ci & push代码

releasenotes plugins的基本原理

事例: https://api.github.com/repos/otter-projects/canal/milestones

 

最后

 验收结果,比如我的工程: http://otter-projects.github.com/canal/release.html

 效果图: 

 

  

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值