You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.6 KiB

  1. # Makefile for building the project
  2. app_name=spreed
  3. project_dir=$(CURDIR)/../$(app_name)
  4. build_dir=$(CURDIR)/build/artifacts
  5. appstore_dir=$(build_dir)/appstore
  6. source_dir=$(build_dir)/source
  7. sign_dir=$(build_dir)/sign
  8. package_name=$(app_name)
  9. cert_dir=$(HOME)/.nextcloud/certificates
  10. version+=main
  11. all: dev-setup build-production
  12. dev-setup: clean-dev npm-init build-dev
  13. production-setup: clean-dev npm-init build-production
  14. release: appstore create-tag
  15. build-dev: composer-install-dev build-js
  16. build-production: composer-install-production build-js-production
  17. composer-install-dev:
  18. composer install
  19. composer-install-production:
  20. composer install --no-dev --classmap-authoritative
  21. build-js:
  22. npm run dev
  23. build-js-production:
  24. npm run build
  25. watch-js:
  26. npm run watch
  27. test:
  28. npm run test
  29. lint:
  30. npm run lint
  31. lint-fix:
  32. npm run lint:fix
  33. npm-init:
  34. npm ci
  35. npm-update:
  36. npm update
  37. clean:
  38. rm -rf js/*
  39. rm -rf $(build_dir)
  40. clean-dev: clean
  41. rm -rf node_modules
  42. rm -rf vendor
  43. create-tag:
  44. git tag -a v$(version) -m "Tagging the $(version) release."
  45. git push origin v$(version)
  46. appstore:
  47. rm -rf $(build_dir)
  48. mkdir -p $(sign_dir)
  49. rsync -a \
  50. --exclude=babel.config.js \
  51. --exclude=/build \
  52. --exclude=docs \
  53. --exclude=.drone.jsonnet \
  54. --exclude=.drone.yml \
  55. --exclude=.editorconfig \
  56. --exclude=.eslintignore \
  57. --exclude=.eslintrc.js \
  58. --exclude=.git \
  59. --exclude=.gitattributes \
  60. --exclude=.github \
  61. --exclude=.gitignore \
  62. --exclude=jest.config.js \
  63. --exclude=jest.global.setup.js \
  64. --exclude=.l10nignore \
  65. --exclude=mkdocs.yml \
  66. --exclude=Makefile \
  67. --exclude=node_modules \
  68. --exclude=.php-cs-fixer.cache \
  69. --exclude=.php-cs-fixer.dist.php \
  70. --exclude=.php_cs.cache \
  71. --exclude=.php_cs.dist \
  72. --exclude=psalm.xml \
  73. --exclude=README.md \
  74. --exclude=.readthedocs.yaml \
  75. --exclude=/recording \
  76. --exclude=/site \
  77. --exclude=/src \
  78. --exclude=.stylelintignore \
  79. --exclude=stylelint.config.js \
  80. --exclude=.tx \
  81. --exclude=tests \
  82. --exclude=tsconfig.json \
  83. --exclude=vendor/bamarni \
  84. --exclude=vendor/bin \
  85. --exclude=vendor-bin \
  86. --exclude=webpack.common.config.js \
  87. --exclude=webpack.config.js \
  88. $(project_dir)/ $(sign_dir)/$(app_name)
  89. @if [ -f $(cert_dir)/$(app_name).key ]; then \
  90. echo "Signing app files…"; \
  91. php ../../occ integrity:sign-app \
  92. --privateKey=$(cert_dir)/$(app_name).key\
  93. --certificate=$(cert_dir)/$(app_name).crt\
  94. --path=$(sign_dir)/$(app_name); \
  95. fi
  96. tar -czf $(build_dir)/$(app_name).tar.gz \
  97. -C $(sign_dir) $(app_name)
  98. @if [ -f $(cert_dir)/$(app_name).key ]; then \
  99. echo "Signing package…"; \
  100. openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name).tar.gz | openssl base64; \
  101. fi