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`. - Build with `grunt`.
- Continuously build with `grunt watch`. - 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 ### Contribute
- Edit the sources. - Edit the sources.

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
<a class=reset>Reset Settings</a>&nbsp|&nbsp <a class=reset>Reset Settings</a>&nbsp|&nbsp
<input type=file hidden> <input type=file hidden>
<a href='<%= meta.page %>' target=_blank><%= meta.name %></a>&nbsp|&nbsp <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='<%= meta.repo %>issues' target=_blank>Issues</a>&nbsp|&nbsp
<a href=javascript:; class='close fa fa-times' title=Close></a> <a href=javascript:; class='close fa fa-times' title=Close></a>
</div> </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. * Licensed under the MIT license.
* <%= meta.repo %>blob/master/LICENSE * <%= meta.repo %>blob/master/LICENSE

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='<%= meta.appid %>'> <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> </app>
</gupdate> </gupdate>