0
0
mirror of https://github.com/netdata/netdata.git synced 2024-11-21 15:28:05 +00:00
netdata_netdata/packaging/windows/package-windows.sh
thiagoftsm b7924fd125
MSI Improvements (#18903)
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
2024-11-07 19:58:25 +02:00

45 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
repo_root="$(dirname "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd -P)")")"
# shellcheck source=./win-build-dir.sh
. "${repo_root}/packaging/windows/win-build-dir.sh"
set -eu -o pipefail
# Regenerate keys everytime there is an update
if [ -d /opt/netdata/etc/pki/ ]; then
rm -rf /opt/netdata/etc/pki/
fi
# Remove previous installation of msys2 script
if [ -f /opt/netdata/usr/bin/bashbug ]; then
rm -rf /opt/netdata/usr/bin/bashbug
fi
${GITHUB_ACTIONS+echo "::group::Installing"}
cmake --install "${build}"
${GITHUB_ACTIONS+echo "::endgroup::"}
if [ ! -f "/msys2-latest.tar.zst" ]; then
${GITHUB_ACTIONS+echo "::group::Fetching MSYS2 files"}
"${repo_root}/packaging/windows/fetch-msys2-installer.py" /msys2-latest.tar.zst
${GITHUB_ACTIONS+echo "::endgroup::"}
fi
${GITHUB_ACTIONS+echo "::group::Licenses"}
if [ ! -f "/gpl-3.0.txt" ]; then
curl -o /gpl-3.0.txt "https://www.gnu.org/licenses/gpl-3.0.txt"
fi
if [ ! -f "/cloud.txt" ]; then
curl -o /cloud.txt "https://app.netdata.cloud/LICENSE.txt"
fi
${GITHUB_ACTIONS+echo "::endgroup::"}
${GITHUB_ACTIONS+echo "::group::Copy Files"}
tar -xf /msys2-latest.tar.zst -C /opt/netdata/ || exit 1
cp -R /opt/netdata/msys64/* /opt/netdata/ || exit 1
rm -rf /opt/netdata/msys64/
${GITHUB_ACTIONS+echo "::endgroup::"}