Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .PHONY: test
  2. build: clean lint build_python build_electron
  3. publish: clean lint publish_github_electron publish_python publish_github_pages publish_cask
  4. install:
  5. rm -rf ./node_modules
  6. rm -rf ./package-lock.json
  7. npm install
  8. clean:
  9. rm -rf ./dist
  10. reset:
  11. rm -rf ./dist
  12. rm -rf ./node_modules
  13. rm -rf ./third_party
  14. rm -rf ./package-lock.json
  15. update:
  16. @[ -d node_modules ] || npm install
  17. @./tools/armnn sync schema
  18. @./tools/bigdl sync schema
  19. @./tools/caffe sync schema
  20. @./tools/coreml sync schema
  21. @./tools/chainer sync
  22. @./tools/cntk sync schema
  23. @./tools/darknet sync
  24. @./tools/dl4j sync
  25. @./tools/keras sync install metadata
  26. @./tools/mediapipe sync
  27. @./tools/mlnet sync metadata
  28. @./tools/mnn sync schema
  29. @./tools/mxnet sync metadata
  30. @./tools/ncnn sync
  31. @./tools/onnx sync install schema metadata
  32. @./tools/paddle sync schema
  33. @./tools/pytorch sync install schema metadata
  34. @./tools/sklearn sync install metadata
  35. @./tools/tengine sync
  36. @./tools/tf sync install schema metadata
  37. @./tools/tflite sync schema
  38. @./tools/torch sync
  39. build_python:
  40. @[ -d node_modules ] || npm install
  41. python3 ./setup.py build --version
  42. build_electron:
  43. @[ -d node_modules ] || npm install
  44. npx electron-builder install-app-deps
  45. npx electron-builder --mac
  46. npx electron-builder --win
  47. npx electron-builder --linux appimage
  48. npx electron-builder --linux snap
  49. lint:
  50. @[ -d node_modules ] || npm install
  51. npx eslint src/*.js test/*.js
  52. test:
  53. @[ -d node_modules ] || npm install
  54. node ./test/test.js
  55. start:
  56. @[ -d node_modules ] || npm install
  57. npx electron .
  58. publish_python:
  59. @[ -d node_modules ] || npm install
  60. python3 ./setup.py build --version bdist_wheel
  61. python3 -m pip install --user keyring
  62. python3 -m pip install --user twine
  63. twine upload dist/dist/*
  64. publish_github_electron:
  65. @[ -d node_modules ] || npm install
  66. npx electron-builder install-app-deps
  67. npx electron-builder --mac --publish always
  68. npx electron-builder --win --publish always
  69. npx electron-builder --linux appimage --publish always
  70. npx electron-builder --linux snap --publish always
  71. publish_github_pages:
  72. @[ -d node_modules ] || npm install
  73. python3 ./setup.py build --version
  74. rm -rf ./dist/gh-pages
  75. git clone [email protected]:lutzroeder/netron.git ./dist/gh-pages --branch gh-pages
  76. rm -rf ./dist/gh-pages/*
  77. cp -R ./dist/lib/netron/* ./dist/gh-pages/
  78. rm -rf ./dist/gh-pages/*.py*
  79. @export PACKAGE_VERSION=`node -pe "require('./package.json').version"`; \
  80. sed -i -e "s/<!-- meta -->/<meta name='version' content='$$PACKAGE_VERSION' \/>/g" ./dist/gh-pages/index.html
  81. git -C ./dist/gh-pages add --all
  82. git -C ./dist/gh-pages commit --amend --no-edit
  83. git -C ./dist/gh-pages push --force origin gh-pages
  84. publish_cask:
  85. @curl -H "Authorization: token $(GITHUB_TOKEN)" https://api.github.com/repos/Homebrew/homebrew-cask/forks -d ''
  86. @export PACKAGE_VERSION=`node -pe "require('./package.json').version"`; \
  87. cask-repair --cask-version $$PACKAGE_VERSION --blind-submit netron
  88. @curl -H "Authorization: token $(GITHUB_TOKEN)" -X "DELETE" https://api.github.com/repos/lutzroeder/homebrew-cask