updated the runner to utilize caching
This commit is contained in:
+15
-6
@@ -18,10 +18,19 @@ case "$ARCH" in
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -fL -o /tmp/odin.tar.gz \
|
||||
"https://github.com/odin-lang/Odin/releases/download/${VERSION}/odin-linux-${OBJ_ARCH}-${VERSION}.tar.gz"
|
||||
mkdir -p /tmp/odin
|
||||
tar -xzf /tmp/odin.tar.gz -C /tmp/odin --strip-components=1
|
||||
# If a prior job restored the install from cache, reuse it instead of
|
||||
# re-downloading. The extracted Odin binary already on PATH is authoritative;
|
||||
# otherwise fetch the version (plus the raylib workaround) fresh.
|
||||
if [ -x /tmp/odin/odin ]; then
|
||||
echo "Odin ${VERSION} found in cache (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"
|
||||
BIN_DIR=/tmp/odin
|
||||
else
|
||||
curl -fL -o /tmp/odin.tar.gz \
|
||||
"https://github.com/odin-lang/Odin/releases/download/${VERSION}/odin-linux-${OBJ_ARCH}-${VERSION}.tar.gz"
|
||||
mkdir -p /tmp/odin
|
||||
tar -xzf /tmp/odin.tar.gz -C /tmp/odin --strip-components=1
|
||||
BIN_DIR=/tmp/odin
|
||||
fi
|
||||
|
||||
# Work around an Odin binding bug: for ODIN_ARCH == .arm64 the vendored
|
||||
# raylib references `vendor/raylib/linux-arm/libraylib.a`, but the release
|
||||
@@ -33,7 +42,7 @@ if [ "${OBJ_ARCH}" = "arm64" ] \
|
||||
fi
|
||||
|
||||
if [ -n "${GITHUB_PATH:-}" ]; then
|
||||
echo "/tmp/odin" >> "$GITHUB_PATH"
|
||||
echo "${BIN_DIR}" >> "$GITHUB_PATH"
|
||||
fi
|
||||
|
||||
echo "Installed Odin ${VERSION} (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"
|
||||
echo "Odin ${VERSION} ready (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"
|
||||
|
||||
Reference in New Issue
Block a user