package-windows.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. repo_root="$(dirname "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd -P)")")"
  3. # shellcheck source=./win-build-dir.sh
  4. . "${repo_root}/packaging/windows/win-build-dir.sh"
  5. set -eu -o pipefail
  6. # Regenerate keys everytime there is an update
  7. if [ -d /opt/netdata/etc/pki/ ]; then
  8. rm -rf /opt/netdata/etc/pki/
  9. fi
  10. # Remove previous installation of msys2 script
  11. if [ -f /opt/netdata/usr/bin/bashbug ]; then
  12. rm -rf /opt/netdata/usr/bin/bashbug
  13. fi
  14. ${GITHUB_ACTIONS+echo "::group::Installing"}
  15. cmake --install "${build}"
  16. ${GITHUB_ACTIONS+echo "::endgroup::"}
  17. if [ ! -f "/msys2-latest.tar.zst" ]; then
  18. ${GITHUB_ACTIONS+echo "::group::Fetching MSYS2 files"}
  19. "${repo_root}/packaging/windows/fetch-msys2-installer.py" /msys2-latest.tar.zst
  20. ${GITHUB_ACTIONS+echo "::endgroup::"}
  21. fi
  22. ${GITHUB_ACTIONS+echo "::group::Licenses"}
  23. if [ ! -f "/gpl-3.0.txt" ]; then
  24. curl -o /gpl-3.0.txt "https://www.gnu.org/licenses/gpl-3.0.txt"
  25. fi
  26. if [ ! -f "/cloud.txt" ]; then
  27. curl -o /cloud.txt "https://app.netdata.cloud/LICENSE.txt"
  28. fi
  29. ${GITHUB_ACTIONS+echo "::endgroup::"}
  30. ${GITHUB_ACTIONS+echo "::group::Copy Files"}
  31. tar -xf /msys2-latest.tar.zst -C /opt/netdata/ || exit 1
  32. cp -R /opt/netdata/msys64/* /opt/netdata/ || exit 1
  33. rm -rf /opt/netdata/msys64/
  34. ${GITHUB_ACTIONS+echo "::endgroup::"}
  35. ${GITHUB_ACTIONS+echo "::group::Configure Editor"}
  36. if [ -f /opt/netdata/etc/profile ]; then
  37. echo 'EDITOR="/usr/bin/nano.exe"' >> /opt/netdata/etc/profile
  38. fi
  39. ${GITHUB_ACTIONS+echo "::endgroup::"}