ソースを参照

Use Makefile instead of tools/publish script

Lutz Roeder 8 年 前
コミット
eca779faa5
2 ファイル変更24 行追加67 行削除
  1. 24 21
      Makefile
  2. 0 46
      tools/publish

+ 24 - 21
Makefile

@@ -1,38 +1,41 @@
 
-PACKAGE_VERSION=`node -pe "require('./package.json').version"`
+build: build_python build_electron
 
-dist: dist_electron dist_pip
-
-publish: clean dist publish_pip publish_github publish_cask
+publish: clean publish_pip publish_github publish_cask
 
 install:
-	@rm -rf node_modules
-	@npm install
-	@npx electron-builder install-app-deps
+	rm -rf node_modules
+	npm install
 
 clean:
-	@rm -rf dist
-	@rm -rf build
+	rm -rf dist
+	rm -rf build
 
-dist_electron:
-	@npx electron-builder install-app-deps
-	@npx electron-builder --mac --linux --win
+build_python:
+	npm install
+	python setup.py build
 
-dist_pip:
-	@python setup.py build bdist_wheel
+build_electron:
+	npm install
+	npx electron-builder install-app-deps
+	npx electron-builder --mac --linux --win
 
 start:
-	@npx electron .
+	npx electron .
+
+start_python:
+	PYTHONPATH=./build/lib python ./build/scripts-2.7/netron $@
 
 publish_pip:
-	@python setup.py upload
+	python setup.py build bdist_wheel upload
 
 publish_github:
-	export GH_TOKEN=$(GITHUB_TOKEN);
 	npx electron-builder install-app-deps
-	npx electron-builder --publish always --draft false --prerelease false
+	@export GH_TOKEN=$(GITHUB_TOKEN); \
+	npx electron-builder --mac --linux --win --publish always --draft false --prerelease false
 
 publish_cask:
-	curl -H "Authorization: token $(GITHUB_TOKEN)" https://api.github.com/repos/caskroom/homebrew-cask/forks -d ''
-	cask-repair --cask-version $(PACKAGE_VERSION) --blind-submit netron
-	curl -H "Authorization: token $(GITHUB_TOKEN)" -X "DELETE" https://api.github.com/repos/lutzroeder/homebrew-cask
+	@curl -H "Authorization: token $(GITHUB_TOKEN)" https://api.github.com/repos/caskroom/homebrew-cask/forks -d ''
+	@export PACKAGE_VERSION=`node -pe "require('./package.json').version"`; \
+	cask-repair --cask-version $$PACKAGE_VERSION --blind-submit netron
+	@curl -H "Authorization: token $(GITHUB_TOKEN)" -X "DELETE" https://api.github.com/repos/lutzroeder/homebrew-cask

+ 0 - 46
tools/publish

@@ -1,46 +0,0 @@
-
-bold() {
-    echo "$(tty -s && tput bold)$1$(tty -s && tput sgr0)" 
-}
-
-clean() {
-    bold "clean"
-    sudo rm -rf build
-    sudo rm -rf dist
-}
-
-pip() {
-    bold "publish to pip" 
-    ./setup.py build bdist_wheel upload
-}
-
-github() {
-    bold "publish to github"
-    export GH_TOKEN=${GITHUB_TOKEN} 
-    npm run release
-}
-
-cask() {
-    bold "update brew cask"
-    PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
-    curl -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/caskroom/homebrew-cask/forks -d ''
-    cask-repair --cask-version ${PACKAGE_VERSION} --blind-submit netron
-    curl -H "Authorization: token ${GITHUB_TOKEN}" -X "DELETE" https://api.github.com/repos/lutzroeder/homebrew-cask
-}
-
-all() {
-    clean
-    pip
-    github
-    sleep 1m
-    cask
-}
-
-target="$1"
-
-case "${target}" in
-    "pip") pip;;
-    "github") github;;
-    "cask") cask;;
-    *) all;;
-esac