diff --git a/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim b/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim index fb7b41c5e..ea17c2afb 100644 --- a/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim +++ b/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim @@ -1,49 +1,46 @@ function! s:body() abort - return 'SpaceVim development (pre-release:' . g:spacevim_version . ') build.' + return 'SpaceVim development (pre-release:' . g:spacevim_version . ') build.' endfunction function! SpaceVim#dev#releases#open() abort - let username = input('github username:') - let password = input('github password:') - let is_dev = g:spacevim_version =~ 'dev' - let releases = { - \ 'tag_name': (is_dev ? 'nightly' : g:spacevim_version), - \ 'target_commitish': 'dev', - \ 'name': (is_dev ? 'nightly' : 'SpaceVim v' . g:spacevim_version), - \ 'body': (is_dev ? s:body() : SpaceVim#dev#releases#content()), - \ 'draft': v:false, - \ 'prerelease': (is_dev ? v:true : v:false) - \ } - let response = github#api#repos#releases#Create('SpaceVim', 'SpaceVim', - \ username, password, releases) - if !empty(response) - echomsg 'releases successed! ' . response.url - else - echom 'releases failed!' - endif -endfunction - -function! s:get_list_of_PRs() abort - let prs = github#api#issues#List_All_for_Repo('SpaceVim', 'SpaceVim', - \ { - \ 'state' : 'closed', - \ 'since' : s:time_of_last_release(), - \ }) - return filter(prs, 'has_key(v:val, "pull_request")') -endfunction - -function! s:time_of_last_release() abort - let last_release = github#api#repos#releases#latest('SpaceVim', 'SpaceVim') - if has_key(last_release, 'created_at') - return last_release.created_at + let username = input('github username:') + let password = input('github password:') + let is_dev = g:spacevim_version =~ 'dev' + let releases = { + \ 'tag_name': (is_dev ? 'nightly' : g:spacevim_version), + \ 'target_commitish': 'dev', + \ 'name': (is_dev ? 'nightly' : 'SpaceVim v' . g:spacevim_version), + \ 'body': (is_dev ? s:body() : SpaceVim#dev#releases#content()), + \ 'draft': v:false, + \ 'prerelease': (is_dev ? v:true : v:false) + \ } + let response = github#api#repos#releases#Create('SpaceVim', 'SpaceVim', + \ username, password, releases) + if !empty(response) + echomsg 'releases successed! ' . response.url else - return '' + echom 'releases failed!' endif endfunction +function! List(owner, repo, page) abort + return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues?state=closed&page=' . a:page , []) +endfunction + +" v0.4.0 is released at https://github.com/SpaceVim/SpaceVim/pull/768 +" v0.5.0 is released at https://github.com/SpaceVim/SpaceVim/pull/966 +function! s:get_list_of_PRs() abort + let prs = [] + for i in range(1, 10) + let issues = List('SpaceVim','SpaceVim', i) + call extend(prs, filter(issues, 'v:val["number"] > 768 && v:val["number"] < 966')) + endfor + return filter(prs, 'has_key(v:val, "pull_request")') +endfunction + function! s:pr_to_list(pr) abort return '- ' . a:pr.title . ' [#' . a:pr.number . '](' . a:pr.html_url . ')' endfunction - +let g:wsd = [] function! SpaceVim#dev#releases#content() let md = [ \ '### SpaceVim release ' . g:spacevim_version @@ -52,12 +49,15 @@ function! SpaceVim#dev#releases#content() let changes = [] let fixs = [] let others = [] - for pr in s:get_list_of_PRs() - if pr.title =~ '^ADD:' + if g:wsd == [] + let g:wsd =s:get_list_of_PRs() + endif + for pr in g:wsd + if pr.title =~? '^ADD' call add(adds, s:pr_to_list(pr)) - elseif pr.title =~ '^CHANGE:' + elseif pr.title =~? '^CHANGE' call add(changes, s:pr_to_list(pr)) - elseif pr.title =~ '^FIX:' + elseif pr.title =~? '^FIX' call add(fixs, s:pr_to_list(pr)) else call add(others, s:pr_to_list(pr)) @@ -67,21 +67,29 @@ function! SpaceVim#dev#releases#content() call add(md, '') call add(md, '#### New Features') call add(md, '') + call extend(md, adds) + call add(md, '') endif if !empty(changes) call add(md, '') call add(md, '#### Feature Changes') call add(md, '') + call extend(md, changes) + call add(md, '') endif if !empty(fixs) call add(md, '') call add(md, '#### Bug Fixs') call add(md, '') + call extend(md, fixs) + call add(md, '') endif if !empty(others) call add(md, '') call add(md, '#### Unmarked PRs') call add(md, '') + call extend(md, others) + call add(md, '') endif return join(md, "\n") diff --git a/README.md b/README.md index e130aceb8..31437f437 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) [![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev) [![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev) -![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg) +![Version](https://img.shields.io/badge/version-0.5.0-FF00CC.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg)](doc/SpaceVim.txt) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/SpaceVim/SpaceVim.svg)](http://isitmaintained.com/project/SpaceVim/SpaceVim "Average time to resolve an issue") diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 3a35da051..42abfaadb 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -27,7 +27,7 @@ "" " Version of SpaceVim , this value can not be changed. scriptencoding utf-8 -let g:spacevim_version = '0.5.0-dev' +let g:spacevim_version = '0.5.0' lockvar g:spacevim_version "" " Change the default indentation of SpaceVim. Default is 2. diff --git a/docs/README_zh_cn.md b/docs/README_zh_cn.md index 819d26524..da424a396 100644 --- a/docs/README_zh_cn.md +++ b/docs/README_zh_cn.md @@ -7,7 +7,7 @@ description: "SpaceVim 是一个社区驱动的 Vim 配置,内含多种语言 # SpaceVim 中文手册 [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) -![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg) +![Version](https://img.shields.io/badge/version-0.5.0-FF00CC.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE) [![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://github.com/SpaceVim/SpaceVim/blob/dev/doc/SpaceVim.txt) [![QQ](https://img.shields.io/badge/QQ群-121056965-blue.svg)](https://jq.qq.com/?_wv=1027&k=43DB6SG) diff --git a/docs/index.md b/docs/index.md index f291c289b..959c6d110 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,7 +6,7 @@ description: "SpaceVim is a community-driven vim distribution that seeks to prov # Introduction [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) -![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg) +![Version](https://img.shields.io/badge/version-0.5.0-FF00CC.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/LICENSE) [![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://raw.githubusercontent.com/SpaceVim/SpaceVim/dev/doc/SpaceVim.txt) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/SpaceVim/SpaceVim.svg)](http://isitmaintained.com/project/SpaceVim/SpaceVim "Average time to resolve an issue") diff --git a/docs/install.cmd b/docs/install.cmd index 9b5bed881..50f19506f 100644 --- a/docs/install.cmd +++ b/docs/install.cmd @@ -11,7 +11,7 @@ echo " \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ echo " | ## " echo " | ## " echo " |__/ " -echo " version : 0.5.0-dev by : spacevim.org " +echo " version : 0.5.0 by : spacevim.org " Push-Location ~ diff --git a/docs/install.sh b/docs/install.sh index 2a0d80ea2..1ee76b864 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -11,7 +11,7 @@ # Reset Color_off='\033[0m' # Text Reset -Version='0.5.0-dev' +Version='0.5.0' # Regular Colors Red='\033[0;31m' diff --git a/readme.gitee.md b/readme.gitee.md index 5cb69a96b..20def8d92 100644 --- a/readme.gitee.md +++ b/readme.gitee.md @@ -1,7 +1,7 @@ [![SpaceVim](https://spacevim.org/logo.png)](https://spacevim.org) [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) -![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg) +![Version](https://img.shields.io/badge/version-0.5.0-FF00CC.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE) [![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://github.com/SpaceVim/SpaceVim/blob/dev/doc/SpaceVim.txt) [![QQ](https://img.shields.io/badge/QQ群-121056965-blue.svg)](https://jq.qq.com/?_wv=1027&k=43DB6SG)