v0.1.16 - Re-upload release with new Gitea token - nsigner + nsigner_client static binaries

This commit is contained in:
Laan Tungir
2026-08-05 19:28:32 -04:00
parent e65ed5c5d6
commit 697a79dc25
2 changed files with 166 additions and 2 deletions
+164
View File
@@ -0,0 +1,164 @@
#!/bin/bash
#
# deploy_local.sh — Build static nsigner + nsigner_client binaries
# and install them to /usr/local/bin/
#
# Usage:
# ./deploy_local.sh # build + install (prompts for sudo)
# ./deploy_local.sh --no-build # install existing build/ binaries only
# ./deploy_local.sh --force # skip confirmation prompt
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="$SCRIPT_DIR/build"
INSTALL_PREFIX="/usr/local/bin"
HOST_UNAME="$(uname -m)"
case "$HOST_UNAME" in
x86_64) ARCH="x86_64" ;;
aarch64|arm64) ARCH="arm64" ;;
armv7l|armv7) ARCH="armv7" ;;
*)
echo "ERROR: Unsupported host architecture '$HOST_UNAME'"
exit 1
;;
esac
case "$ARCH" in
x86_64)
SIGNER_BIN="$BUILD_DIR/nsigner_static_x86_64"
CLIENT_BIN="$BUILD_DIR/nsigner_client_static_x86_64"
;;
arm64)
SIGNER_BIN="$BUILD_DIR/nsigner_static_arm64"
CLIENT_BIN="$BUILD_DIR/nsigner_client_static_arm64"
;;
armv7)
SIGNER_BIN="$BUILD_DIR/nsigner_static_armv7"
CLIENT_BIN="$BUILD_DIR/nsigner_client_static_armv7"
;;
esac
DO_BUILD=true
FORCE=false
while [[ $# -gt 0 ]]; do
case "$1" in
--no-build)
DO_BUILD=false
shift
;;
--force|-f)
FORCE=true
shift
;;
-h|--help)
echo "deploy_local.sh — Build and install nsigner + nsigner_client to $INSTALL_PREFIX"
echo ""
echo "Usage: $0 [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " --no-build Skip build step; install existing binaries from build/"
echo " --force, -f Skip confirmation prompt"
echo " -h, --help Show this help message"
exit 0
;;
*)
echo "ERROR: Unknown argument '$1'"
echo "Usage: $0 [--no-build] [--force]"
exit 1
;;
esac
done
echo "=========================================="
echo "nsigner local deploy"
echo "=========================================="
echo "Architecture: $ARCH"
echo "Install dir: $INSTALL_PREFIX"
echo "Signer binary: $SIGNER_BIN"
echo "Client binary: $CLIENT_BIN"
echo ""
# --- Build step ---------------------------------------------------------------
if $DO_BUILD; then
echo "[1/3] Building static binaries via build_static.sh"
echo ""
bash "$SCRIPT_DIR/build_static.sh" --arch "$ARCH"
echo ""
else
echo "[1/3] Skipping build (--no-build)"
fi
# --- Verify binaries exist ----------------------------------------------------
echo "[2/3] Verifying binaries"
if [[ ! -f "$SIGNER_BIN" ]]; then
echo "ERROR: Signer binary not found: $SIGNER_BIN"
echo " Run without --no-build, or run build_static.sh first."
exit 1
fi
if [[ ! -x "$SIGNER_BIN" ]]; then
echo "ERROR: Signer binary is not executable: $SIGNER_BIN"
exit 1
fi
if [[ ! -f "$CLIENT_BIN" ]]; then
echo "ERROR: Client binary not found: $CLIENT_BIN"
echo " Run without --no-build, or run build_static.sh first."
exit 1
fi
if [[ ! -x "$CLIENT_BIN" ]]; then
echo "ERROR: Client binary is not executable: $CLIENT_BIN"
exit 1
fi
echo " OK: $SIGNER_BIN ($(du -h "$SIGNER_BIN" | cut -f1))"
echo " OK: $CLIENT_BIN ($(du -h "$CLIENT_BIN" | cut -f1))"
# Quick smoke test
SIGNER_VERSION="$("$SIGNER_BIN" --version 2>&1 || echo "unknown")"
echo " Signer version: $SIGNER_VERSION"
# --- Confirm ------------------------------------------------------------------
if ! $FORCE; then
echo ""
echo "About to install:"
echo " $SIGNER_BIN -> $INSTALL_PREFIX/nsigner"
echo " $CLIENT_BIN -> $INSTALL_PREFIX/nsigner_client"
echo ""
read -r -p "Proceed? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY]) ;;
*)
echo "Aborted."
exit 0
;;
esac
fi
# --- Install ------------------------------------------------------------------
echo ""
echo "[3/3] Installing to $INSTALL_PREFIX"
SUDO=""
if [[ $EUID -ne 0 ]]; then
if ! command -v sudo >/dev/null 2>&1; then
echo "ERROR: Need root privileges to write to $INSTALL_PREFIX but sudo is not available"
exit 1
fi
SUDO="sudo"
fi
$SUDO install -m 0755 "$SIGNER_BIN" "$INSTALL_PREFIX/nsigner"
$SUDO install -m 0755 "$CLIENT_BIN" "$INSTALL_PREFIX/nsigner_client"
echo ""
echo "=========================================="
echo "Deploy complete!"
echo "=========================================="
echo " $INSTALL_PREFIX/nsigner"
echo " $INSTALL_PREFIX/nsigner_client"
echo ""
echo "Verify:"
echo " nsigner --version"
echo " nsigner_client --help"
+2 -2
View File
@@ -813,8 +813,8 @@ int socket_name_random(char *out, size_t out_len);
/* Version information (auto-updated by build/version tooling) */
#define NSIGNER_VERSION_MAJOR 0
#define NSIGNER_VERSION_MINOR 1
#define NSIGNER_VERSION_PATCH 15
#define NSIGNER_VERSION "v0.1.15"
#define NSIGNER_VERSION_PATCH 16
#define NSIGNER_VERSION "v0.1.16"
/* NSIGNER_HEADERLESS_DECLS_END */