summaryrefslogtreecommitdiffstats
path: root/packaging/installer/package-windows.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 08:15:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 08:15:20 +0000
commit87d772a7d708fec12f48cd8adc0dedff6e1025da (patch)
tree1fee344c64cc3f43074a01981e21126c8482a522 /packaging/installer/package-windows.sh
parentAdding upstream version 1.46.3. (diff)
downloadnetdata-87d772a7d708fec12f48cd8adc0dedff6e1025da.tar.xz
netdata-87d772a7d708fec12f48cd8adc0dedff6e1025da.zip
Adding upstream version 1.47.0.upstream/1.47.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/package-windows.sh')
-rwxr-xr-xpackaging/installer/package-windows.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/packaging/installer/package-windows.sh b/packaging/installer/package-windows.sh
new file mode 100755
index 00000000..7b1c57e4
--- /dev/null
+++ b/packaging/installer/package-windows.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+repo_root="$(dirname "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd -P)")")"
+
+if [ -n "${BUILD_DIR}" ]; then
+ build="${BUILD_DIR}"
+elif [ -n "${OSTYPE}" ]; then
+ if [ -n "${MSYSTEM}" ]; then
+ build="${repo_root}/build-${OSTYPE}-${MSYSTEM}"
+ else
+ build="${repo_root}/build-${OSTYPE}"
+ fi
+elif [ "$USER" = "vk" ]; then
+ build="${repo_root}/build"
+else
+ build="${repo_root}/build"
+fi
+
+set -exu -o pipefail
+
+${GITHUB_ACTIONS+echo "::group::Installing"}
+cmake --install "${build}"
+${GITHUB_ACTIONS+echo "::endgroup::"}
+
+if [ ! -f "/msys2-installer.exe" ]; then
+ ${GITHUB_ACTIONS+echo "::group::Fetching MSYS2 installer"}
+ "${repo_root}/packaging/windows/fetch-msys2-installer.py" /msys2-installer.exe
+ ${GITHUB_ACTIONS+echo "::endgroup::"}
+fi
+
+${GITHUB_ACTIONS+echo "::group::Packaging"}
+NDVERSION=$"$(grep 'CMAKE_PROJECT_VERSION:STATIC' "${build}/CMakeCache.txt"| cut -d= -f2)"
+NDMAJORVERSION=$"$(grep 'CMAKE_PROJECT_VERSION_MAJOR:STATIC' "${build}/CMakeCache.txt"| cut -d= -f2)"
+NDMINORVERSION=$"$(grep 'CMAKE_PROJECT_VERSION_MINOR:STATIC' "${build}/CMakeCache.txt"| cut -d= -f2)"
+
+if [ -f "/gpl-3.0.txt" ]; then
+ ${GITHUB_ACTIONS+echo "::group::Fetching GPL3 License"}
+ curl -o /gpl-3.0.txt "https://www.gnu.org/licenses/gpl-3.0.txt"
+ ${GITHUB_ACTIONS+echo "::endgroup::"}
+fi
+
+/mingw64/bin/makensis.exe -DCURRVERSION="${NDVERSION}" -DMAJORVERSION="${NDMAJORVERSION}" -DMINORVERSION="${NDMINORVERSION}" "${repo_root}/packaging/windows/installer.nsi"
+${GITHUB_ACTIONS+echo "::endgroup::"}