summaryrefslogtreecommitdiffstats
path: root/.github/scripts/get-static-cache-key.sh
diff options
context:
space:
mode:
Diffstat (limited to '.github/scripts/get-static-cache-key.sh')
-rwxr-xr-x.github/scripts/get-static-cache-key.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/.github/scripts/get-static-cache-key.sh b/.github/scripts/get-static-cache-key.sh
new file mode 100755
index 000000000..d9fa28597
--- /dev/null
+++ b/.github/scripts/get-static-cache-key.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+arch="${1}"
+platform="$(packaging/makeself/uname2platform.sh "${arch}")"
+
+docker pull --platform "${platform}" netdata/static-builder
+
+# shellcheck disable=SC2046
+cat $(find packaging/makeself/jobs -type f ! -regex '.*\(netdata\|-makeself\).*') > /tmp/static-cache-key-data
+
+docker run -it --rm --platform "${platform}" netdata/static-builder sh -c 'apk list -I 2>/dev/null' >> /tmp/static-cache-key-data
+
+h="$(sha256sum /tmp/static-cache-key-data | cut -f 1 -d ' ')"
+
+echo "::set-output name=key::static-${arch}-${h}"