summaryrefslogtreecommitdiff
path: root/download_artifact.sh
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2023-12-30 13:47:07 +0100
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2023-12-30 13:47:07 +0100
commit48e6f061420a9da04ed658e35d1ad8768791147f (patch)
tree0ff0e2696d42375182a6ecf33e1ead425fe1cb62 /download_artifact.sh
parent7bd5002cc92e71ed972a08dc5ebd6478cc3680d4 (diff)
feat: cache build results
debug: void MONERO_DEBUG_test0(); bool MONERO_DEBUG_test1(bool x); int MONERO_DEBUG_test2(int x); uint64_t MONERO_DEBUG_test3(uint64_t x); void* MONERO_DEBUG_test4(uint64_t x); const char* MONERO_DEBUG_test5(); const char* MONERO_DEBUG_test5_std();
Diffstat (limited to 'download_artifact.sh')
-rw-r--r--download_artifact.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/download_artifact.sh b/download_artifact.sh
new file mode 100644
index 0000000..72e3f80
--- /dev/null
+++ b/download_artifact.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Usage: ${{ github.workspace }}/download_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
+set -e
+registry_user=mrcyjanek
+cache_name="$1"
+cache_key="$2"
+path_to_file="$3.xz"
+basename="$(basename $path_to_file)"
+
+curl "https://git.mrcyjanek.net/api/packages/mrcyjanek/generic/monero_c/${cache_name}-${cache_key}/${basename}" > /tmp/cache || exit 0
+if [[ "xpackage does not exist" == "x$(head -1 /tmp/cache)" ]];
+then
+ echo "Cache miss $@"
+ rm /tmp/cache
+ exit 0
+fi
+
+mkdir -p $path_to_file
+rm -rf $path_to_file
+mv /tmp/cache $path_to_file
+unxz $path_to_file || rm $path_to_file \ No newline at end of file