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.

118 lines
2.5 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+=master
  11. all: dev-setup build-production
  12. dev-setup: clean-dev composer-install-dev npm-init
  13. release: appstore create-tag
  14. build-dev: composer-install-dev build-js
  15. build-production: composer-install-production build-js-production
  16. composer-install-dev:
  17. composer install
  18. composer-install-production:
  19. composer install --no-dev
  20. build-js:
  21. npm run dev
  22. build-js-production:
  23. npm run build
  24. watch-js:
  25. npm run watch
  26. test:
  27. npm run test:unit
  28. lint:
  29. npm run lint
  30. lint-fix:
  31. npm run lint:fix
  32. npm-init:
  33. npm ci
  34. npm-update:
  35. npm update
  36. clean:
  37. rm -rf js/*
  38. rm -rf $(build_dir)
  39. clean-dev: clean
  40. rm -rf node_modules
  41. rm -rf vendor
  42. create-tag:
  43. git tag -a v$(version) -m "Tagging the $(version) release."
  44. git push origin v$(version)
  45. appstore:
  46. rm -rf $(build_dir)
  47. mkdir -p $(sign_dir)
  48. rsync -a \
  49. --exclude=babel.config.js \
  50. --exclude=/build \
  51. --exclude=composer.json \
  52. --exclude=composer.lock \
  53. --exclude=docs \
  54. --exclude=.drone.jsonnet \
  55. --exclude=.drone.yml \
  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=.l10nignore \
  64. --exclude=mkdocs.yml \
  65. --exclude=Makefile \
  66. --exclude=node_modules \
  67. --exclude=package.json \
  68. --exclude=package-lock.json \
  69. --exclude=.php-cs-fixer.cache \
  70. --exclude=.php-cs-fixer.dist.php \
  71. --exclude=.php_cs.cache \
  72. --exclude=.php_cs.dist \
  73. --exclude=psalm.xml \
  74. --exclude=README.md \
  75. --exclude=/src \
  76. --exclude=.stylelintignore \
  77. --exclude=stylelint.config.js \
  78. --exclude=.tx \
  79. --exclude=tests \
  80. --exclude=tsconfig.json \
  81. --exclude=vendor \
  82. --exclude=vendor-bin \
  83. --exclude=webpack.js \
  84. $(project_dir)/ $(sign_dir)/$(app_name)
  85. @if [ -f $(cert_dir)/$(app_name).key ]; then \
  86. echo "Signing app files…"; \
  87. php ../../occ integrity:sign-app \
  88. --privateKey=$(cert_dir)/$(app_name).key\
  89. --certificate=$(cert_dir)/$(app_name).crt\
  90. --path=$(sign_dir)/$(app_name); \
  91. fi
  92. tar -czf $(build_dir)/$(app_name).tar.gz \
  93. -C $(sign_dir) $(app_name)
  94. @if [ -f $(cert_dir)/$(app_name).key ]; then \
  95. echo "Signing package…"; \
  96. openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name).tar.gz | openssl base64; \
  97. fi