Use separate worktree to modify distribution branch.

This commit is contained in:
ccd0 2016-04-08 20:45:37 -07:00
parent eb856e3eee
commit c94545e01b
2 changed files with 26 additions and 6 deletions

View File

@ -203,43 +203,61 @@ module.exports = (grunt) ->
beta: beta:
command: """ command: """
git tag -af beta -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>." git tag -af beta -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>."
cd ..
cd "<%= pkg.meta.path %>.gh-pages"
git checkout gh-pages git checkout gh-pages
git pull git pull
git merge --no-commit -s ours beta git merge --no-commit -s ours beta
git checkout beta "builds/*<%= pkg.meta.suffix.beta %>.*" LICENSE CHANGELOG.md img .gitignore .gitattributes git checkout beta "builds/*<%= pkg.meta.suffix.beta %>.*" LICENSE CHANGELOG.md img .gitignore .gitattributes
git commit -am "Move <%= pkg.meta.name %> v<%= pkg.meta.version %> to beta channel." git commit -am "Move <%= pkg.meta.name %> v<%= pkg.meta.version %> to beta channel."
git checkout - cd ..
cd "<%= pkg.meta.path %>"
""".split('\n').join('&&') """.split('\n').join('&&')
stable: stable:
command: """ command: """
git push . HEAD:bstable git push . HEAD:bstable
git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>." git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>."
cd ..
cd "<%= pkg.meta.path %>.gh-pages"
git checkout gh-pages git checkout gh-pages
git pull git pull
git merge --no-commit -s ours stable git merge --no-commit -s ours stable
git checkout stable "builds/<%= pkg.name %>.*" builds/updates.xml git checkout stable "builds/<%= pkg.name %>.*" builds/updates.xml
git commit -am "Move <%= pkg.meta.name %> v<%= pkg.meta.version %> to stable channel." git commit -am "Move <%= pkg.meta.name %> v<%= pkg.meta.version %> to stable channel."
git checkout - cd ..
cd "<%= pkg.meta.path %>"
""".split('\n').join('&&') """.split('\n').join('&&')
'commit-web': 'commit-web':
command: 'git commit -am "Build web page."' command: 'git commit -am "Build web page."'
web: web:
command: """ command: """
cd ..
cd "<%= pkg.meta.path %>.gh-pages"
git checkout gh-pages git checkout gh-pages
git pull git pull
git merge --no-commit -s ours - git merge --no-commit -s ours -
git checkout - README.md index.html web.css img git checkout - README.md index.html web.css img
git commit -am "Update web page." git commit -am "Update web page."
git checkout - cd ..
cd "<%= pkg.meta.path %>"
""".split('\n').join('&&') """.split('\n').join('&&')
push: push:
command: 'git push origin --tags -f && git push origin --all' command: 'git push origin --tags -f && git push origin --all'
prestore: prestore:
command: 'git checkout stable' command: """
cd ..
cd "<%= pkg.meta.path %>.gh-pages"
git checkout gh-pages
"""
poststore: poststore:
command: 'git checkout -' command: """
cd ..
cd "<%= pkg.meta.path %>"
"""
aws: aws:
command: """ command: """
cd ..
cd "<%= pkg.meta.path %>.gh-pages"
git checkout gh-pages git checkout gh-pages
aws s3 cp builds/ s3://<%= pkg.meta.awsBucket %>/builds/ --recursive --exclude "*" --include "*.js" --cache-control "max-age=600" --content-type "application/javascript; charset=utf-8" aws s3 cp builds/ s3://<%= pkg.meta.awsBucket %>/builds/ --recursive --exclude "*" --include "*.js" --cache-control "max-age=600" --content-type "application/javascript; charset=utf-8"
aws s3 cp builds/ s3://<%= pkg.meta.awsBucket %>/builds/ --recursive --exclude "*" --include "*.crx" --cache-control "max-age=600" --content-type "application/x-chrome-extension" aws s3 cp builds/ s3://<%= pkg.meta.awsBucket %>/builds/ --recursive --exclude "*" --include "*.crx" --cache-control "max-age=600" --content-type "application/x-chrome-extension"
@ -248,7 +266,8 @@ module.exports = (grunt) ->
aws s3 cp img/ s3://<%= pkg.meta.awsBucket %>/img/ --recursive --cache-control "max-age=600" aws s3 cp img/ s3://<%= pkg.meta.awsBucket %>/img/ --recursive --cache-control "max-age=600"
aws s3 cp index.html s3://<%= pkg.meta.awsBucket %> --cache-control "max-age=600" --content-type "text/html; charset=utf-8" aws s3 cp index.html s3://<%= pkg.meta.awsBucket %> --cache-control "max-age=600" --content-type "text/html; charset=utf-8"
aws s3 cp web.css s3://<%= pkg.meta.awsBucket %> --cache-control "max-age=600" --content-type "text/css; charset=utf-8" aws s3 cp web.css s3://<%= pkg.meta.awsBucket %> --cache-control "max-age=600" --content-type "text/css; charset=utf-8"
git checkout - cd ..
cd "<%= pkg.meta.path %>"
""".split('\n').join('&&') """.split('\n').join('&&')
captchas: captchas:
command: 'aws s3 cp captchas.html s3://<%= pkg.meta.awsBucket %> --cache-control "max-age=0" --content-type "text/html; charset=utf-8"' command: 'aws s3 cp captchas.html s3://<%= pkg.meta.awsBucket %> --cache-control "max-age=0" --content-type "text/html; charset=utf-8"'

View File

@ -3,6 +3,7 @@
"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",
"path": "4chan-x",
"fork": "ccd0", "fork": "ccd0",
"page": "https://www.4chan-x.net/", "page": "https://www.4chan-x.net/",
"downloads": "https://www.4chan-x.net/builds/", "downloads": "https://www.4chan-x.net/builds/",