@@ -36,14 +36,32 @@ if ! command -v minisign >/dev/null 2>&1; then
3636 echo " [sign] Installing minisign..."
3737 # Ubuntu's package is not available in the default repositories on every
3838 # runner image (notably ubuntu-24.04-arm). Prefer it when present, then use
39- # the portable Rust distribution as a fallback.
39+ # the upstream portable Linux distribution as a fallback.
4040 if ! sudo apt-get install -y --no-install-recommends minisign > /dev/null 2>&1 ; then
41- if ! command -v cargo > /dev/null 2>&1 ; then
42- echo " [sign] ERROR: minisign is unavailable and cargo is not installed ." >&2
41+ if ! command -v curl > /dev/null 2>&1 || ! command -v sha256sum > /dev/null 2>&1 || ! command -v tar > /dev/null 2>&1 ; then
42+ echo " [sign] ERROR: minisign is unavailable and the Linux fallback prerequisites are missing ." >&2
4343 exit 1
4444 fi
4545 MINISIGN_ROOT=" ${RUNNER_TEMP:- ${TMPDIR:-/ tmp} } /bitfun-minisign"
46- cargo install --registry crates-io --locked --root " $MINISIGN_ROOT " minisign > /dev/null
46+ MINISIGN_VERSION=" 0.12"
47+ case " $( uname -m) " in
48+ x86_64) MINISIGN_ARCH=" x86_64" ;;
49+ aarch64) MINISIGN_ARCH=" aarch64" ;;
50+ * )
51+ echo " [sign] ERROR: unsupported Linux architecture for minisign fallback: $( uname -m) " >&2
52+ exit 1
53+ ;;
54+ esac
55+ MINISIGN_ARCHIVE=" $MINISIGN_ROOT /minisign-linux.tar.gz"
56+ mkdir -p " $MINISIGN_ROOT /bin"
57+ curl -fsSL --retry 3 \
58+ " https://github.com/jedisct1/minisign/releases/download/${MINISIGN_VERSION} /minisign-${MINISIGN_VERSION} -linux.tar.gz" \
59+ -o " $MINISIGN_ARCHIVE "
60+ echo " 9a599b48ba6eb7b1e80f12f36b94ceca7c00b7a5173c95c3efc88d9822957e73 $MINISIGN_ARCHIVE " | sha256sum -c -
61+ tar -xzf " $MINISIGN_ARCHIVE " -C " $MINISIGN_ROOT "
62+ install -m 0755 \
63+ " $MINISIGN_ROOT /minisign-linux/$MINISIGN_ARCH /minisign" \
64+ " $MINISIGN_ROOT /bin/minisign"
4765 export PATH=" $MINISIGN_ROOT /bin:$PATH "
4866 fi
4967fi
0 commit comments