Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .PHONY: test
  2. build: clean lint build_python build_electron
  3. publish: clean lint publish_github_electron publish_pip publish_github_pages publish_cask
  4. install:
  5. rm -rf ./node_modules
  6. npm install
  7. clean:
  8. rm -rf ./build
  9. reset:
  10. rm -rf ./build
  11. rm -rf ./node_modules
  12. rm -rf ./third_party
  13. build_python:
  14. @[ -d node_modules ] || npm install
  15. rm -rf ./build/python
  16. python ./setup.py build --version
  17. build_electron:
  18. @[ -d node_modules ] || npm install
  19. npx electron-builder install-app-deps
  20. npx electron-builder --mac --linux --win
  21. lint:
  22. @[ -d node_modules ] || npm install
  23. npx eslint src/*.js test/*.js
  24. test:
  25. @[ -d node_modules ] || npm install
  26. node ./test/test.js
  27. start:
  28. @[ -d node_modules ] || npm install
  29. npx electron .
  30. publish_pip:
  31. @[ -d node_modules ] || npm install
  32. rm -rf ./build/python
  33. python ./setup.py build --version bdist_wheel
  34. python -m pip install --user keyring
  35. python -m pip install --user twine
  36. twine upload build/python/dist/*
  37. publish_github_electron:
  38. @[ -d node_modules ] || npm install
  39. npx electron-builder install-app-deps
  40. npx electron-builder --mac --linux --win --publish always
  41. publish_github_pages:
  42. @[ -d node_modules ] || npm install
  43. python ./setup.py build --version
  44. rm -rf ./build/gh-pages
  45. git clone [email protected]:lutzroeder/netron.git ./build/gh-pages --branch gh-pages
  46. rm -rf ./build/gh-pages/*
  47. cp -R ./build/python/lib/netron/* ./build/gh-pages/
  48. rm -rf ./build/gh-pages/*.py
  49. rm -rf ./build/gh-pages/*.pyc
  50. rm -rf ./build/gh-pages/netron
  51. mv ./build/gh-pages/view-browser.html ./build/gh-pages/index.html
  52. @export PACKAGE_VERSION=`node -pe "require('./package.json').version"`; \
  53. sed -i -e "s/<!-- meta -->/<meta name='version' content='$$PACKAGE_VERSION' \/>/g" ./build/gh-pages/index.html
  54. git -C ./build/gh-pages add --all
  55. git -C ./build/gh-pages commit --amend --no-edit
  56. git -C ./build/gh-pages push --force origin gh-pages
  57. publish_cask:
  58. @curl -H "Authorization: token $(GITHUB_TOKEN)" https://api.github.com/repos/Homebrew/homebrew-cask/forks -d ''
  59. @export PACKAGE_VERSION=`node -pe "require('./package.json').version"`; \
  60. cask-repair --cask-version $$PACKAGE_VERSION --blind-submit netron
  61. @curl -H "Authorization: token $(GITHUB_TOKEN)" -X "DELETE" https://api.github.com/repos/lutzroeder/homebrew-cask