From 1d232b4cfeb32e0a24a97409a65eb0352c63aff5 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 16 Apr 2016 23:35:37 -0700 Subject: [PATCH] Move tasks: beta, stable, web. --- .gitignore | 1 + Makefile | 40 +++++++++++++++++++++++++++++++++++++--- package.json | 1 + 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b6a1db894..7f9be6fa2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules/ /install.json /.tests_enabled /.events +/dist/ diff --git a/Makefile b/Makefile index f211c97ba..1131aa68a 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,10 @@ template_deps := package.json tools/template.js node_modules/lodash/package.json cat := node tools/cat.js cat_deps := tools/cat.js -name := $(shell node -p "JSON.parse(require('fs').readFileSync('package.json')).name") +pkg = $(shell node -p "JSON.parse(require('fs').readFileSync('package.json')).$1") +name := $(call pkg,name) +nameHuman := $(call pkg,meta.name) +distBranch := $(call pkg,meta.distBranch) version := $(shell node -p "JSON.parse(require('fs').readFileSync('version.json')).version") capitalized = $(filter-out a,$(foreach x,$1,$(subst a $(x),,$(sort a $(x))))) @@ -211,13 +214,19 @@ install.json : node tools/updcl.js echo -> $@ +dist : + git worktree add $@ $(distBranch) + .SECONDARY : -.PHONY: default all clean cleanall script crx release jshint install tag $(foreach i,1 2 3 4,$(bump$(i))) +.PHONY: \ + default all clean cleanall script crx release jshint install \ + tag $(foreach i,1 2 3 4,$(bump$(i))) distready beta stable web clean : - $(RMDIR) tmp testbuilds .events + $(RMDIR) tmp testbuilds .events dist $(RM) .tests_enabled + git worktree prune cleanall : clean $(RMDIR) builds @@ -240,3 +249,28 @@ bump% : $(MAKE) cleanall node tools/bump.js $* $(MAKE) tag install + +distready : | dist + cd dist && git checkout $(distBranch) + cd dist && git pull + +dist/index.html : test.html distready + $(CP) + +beta : distready + git tag -af beta -m "$(nameHuman) v$(version)." + cd dist && git merge --no-commit -s ours beta + cd dist && git checkout beta "builds/*-beta.*" LICENSE CHANGELOG.md img .gitignore .gitattributes + cd dist && git commit -am "Move $(nameHuman) v$(version) to beta channel." + +stable : distready + git push . HEAD:bstable + git tag -af stable -m "$(nameHuman) v$(version)." + cd dist && git merge --no-commit -s ours stable + cd dist && git checkout stable "builds/$(name).*" builds/updates.xml + cd dist && git commit -am "Move $(nameHuman) v$(version) to stable channel." + +web : dist/index.html + cd dist && git merge --no-commit -s ours master + cd dist && git checkout master README.md web.css img + cd dist && git commit -am "Update web page." diff --git a/package.json b/package.json index e9f718c6d..9dc9a50b4 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "chromeStoreID": "ohnjgmpcibpbafdlkimncjhflgedgpam", "recaptchaKey": "6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", "youtubeAPIKey": "AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE", + "distBranch": "gh-pages", "awsBucket": "4chan-x", "matches": [ "*://boards.4chan.org/*",