Makefile 2.3 KB

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