move version number into meta

This commit is contained in:
ccd0 2014-08-10 04:20:54 -07:00
parent 0521ffd23d
commit 786506ecaf
9 changed files with 15 additions and 47 deletions

View File

@ -25,13 +25,6 @@ Reporting bugs:
- Build with `grunt`.
- Continuously build with `grunt watch`.
### Release
- Update the version with `grunt patch`, `grunt minor` or `grunt major`.
- Release with `grunt release`.
Note: this is only used to release new 4chan X versions, and is **not** needed or wanted in pull requests.
### Contribute
- Edit the sources.

View File

@ -114,15 +114,6 @@ module.exports = (grunt) ->
'build-userscript'
]
bump:
options:
updateConfigs: [
'pkg'
]
commit: false
createTag: false
push: false
shell:
options:
stdout: true
@ -132,24 +123,24 @@ module.exports = (grunt) ->
command: 'git checkout <%= pkg.meta.mainBranch %>'
commit:
command: """
git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."
git tag -a <%= pkg.version %> -m "<%= pkg.meta.name %> v<%= pkg.version %>."
git commit -am "Release <%= pkg.meta.name %> v<%= pkg.meta.version %>."
git tag -a <%= pkg.meta.version %> -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>."
"""
beta:
command: """
git tag -af beta -m "<%= pkg.meta.name %> v<%= pkg.version %>."
git tag -af beta -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>."
git checkout gh-pages
git checkout beta 'builds/*<%= pkg.meta.suffix.beta %>.*'
git commit -am "Move <%= pkg.meta.name %> v<%= pkg.version %> to beta channel."
git commit -am "Move <%= pkg.meta.name %> v<%= pkg.meta.version %> to beta channel."
git checkout -
"""
stable:
command: """
git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.version %>."
git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>."
git checkout -b tmp
git merge --no-commit -s ours gh-pages
git checkout gh-pages 'builds/*<%= pkg.meta.suffix.beta %>.*'
git commit -am "Move <%= pkg.meta.name %> v<%= pkg.version %> to stable channel."
git commit -am "Move <%= pkg.meta.name %> v<%= pkg.meta.version %> to stable channel."
git checkout gh-pages
git merge --ff-only tmp
git branch -d tmp
@ -291,24 +282,9 @@ module.exports = (grunt) ->
'shell:push'
]
grunt.registerTask 'patch', [
'bump'
'updcl:3'
]
grunt.registerTask 'minor', [
'bump:minor'
'updcl:2'
]
grunt.registerTask 'major', [
'bump:major'
'updcl:1'
]
grunt.registerTask 'updcl', 'Update the changelog', (headerLevel) ->
headerPrefix = new Array(+headerLevel + 1).join '#'
{version} = grunt.config 'pkg'
{version} = grunt.config('pkg').meta
today = grunt.template.today 'yyyy-mm-dd'
changelog = grunt.file.read 'CHANGELOG.md'

View File

@ -1,9 +1,9 @@
{
"name": "4chan-X",
"version": "1.8.8.6",
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",
"version": "1.8.8.6",
"repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/",
@ -31,7 +31,6 @@
"devDependencies": {
"font-awesome": "~4.0.3",
"grunt": "~0.4.4",
"grunt-bump": "0.0.14",
"grunt-concurrent": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.10.1",

View File

@ -3,7 +3,7 @@ c = console
d = document
doc = d.documentElement
g =
VERSION: '<%= version %>'
VERSION: '<%= meta.version %>'
NAMESPACE: '<%= meta.name %>.'
NAME: '<%= meta.name %>'
FAQ: '<%= meta.faq %>'

View File

@ -7,7 +7,7 @@
<a class=reset>Reset Settings</a>&nbsp|&nbsp
<input type=file hidden>
<a href='<%= meta.page %>' target=_blank><%= meta.name %></a>&nbsp|&nbsp
<a href='<%= meta.repo %>blob/<%= meta.mainBranch %>/CHANGELOG.md' target=_blank><%= version %></a>&nbsp|&nbsp
<a href='<%= meta.repo %>blob/<%= meta.mainBranch %>/CHANGELOG.md' target=_blank><%= meta.version %></a>&nbsp|&nbsp
<a href='<%= meta.repo %>issues' target=_blank>Issues</a>&nbsp|&nbsp
<a href=javascript:; class='close fa fa-times' title=Close></a>
</div>

View File

@ -1,5 +1,5 @@
/*
* <%= meta.name %> - Version <%= version %> - <%= grunt.template.today('yyyy-mm-dd') %>
* <%= meta.name %> - Version <%= meta.version %> - <%= grunt.template.today('yyyy-mm-dd') %>
*
* Licensed under the MIT license.
* <%= meta.repo %>blob/master/LICENSE
@ -77,4 +77,4 @@
* All rights reserved.
*
* license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*/
*/

View File

@ -1,6 +1,6 @@
{
"name": "<%= meta.name %>",
"version": "<%= version %>",
"version": "<%= meta.version %>",
"manifest_version": 2,
"description": "<%= description %>",
"icons": {

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name <%= meta.name %>
// @version <%= version %>
// @version <%= meta.version %>
// @minGMVer <%= meta.min.greasemonkey %>
// @minFFVer <%= meta.min.firefox %>
// @namespace <%= name %>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='<%= meta.appid %>'>
<updatecheck codebase='<%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.crx' version='<%= version %>' />
<updatecheck codebase='<%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.crx' version='<%= meta.version %>' />
</app>
</gupdate>