#!/usr/bin/env bash # Resolve the latest official O3DE Linux .deb. # # Prints shell-eval-able key=value lines: # version=26.05.0 # deb_url=https://o3debinaries.org/main/Latest/Linux/o3de_2605_0.deb # deb_file=o3de_2605_0.deb # sha256= # # Usage: eval "$(scripts/get-latest-version.sh)" set -euo pipefail INDEX="https://o3debinaries.org/download/linux.html" # The download index links to the current stable .deb under main/Latest. DEB_URL=$(curl -fsSL "$INDEX" \ | grep -oE 'https://o3debinaries\.org/main/Latest/Linux/o3de_[0-9_]+\.deb' \ | head -n1 || true) if [ -z "${DEB_URL}" ]; then echo "error: could not find an o3de_*.deb link on ${INDEX}" >&2 exit 1 fi DEB_FILE=$(basename "$DEB_URL") # e.g. o3de_2605_0.deb RAW=${DEB_FILE#o3de_}; RAW=${RAW%.deb} # e.g. 2605_0 # 2605_0 -> 26.05.0 (YYMM_patch -> YY.MM.patch) VERSION=$(printf '%s' "$RAW" | sed -E 's/^([0-9]{2})([0-9]{2})_([0-9]+)$/\1.\2.\3/') SHA256=$(curl -fsSL "${DEB_URL}.sha256" 2>/dev/null | awk 'NR==1{print $1}' || true) echo "version=${VERSION}" echo "deb_url=${DEB_URL}" echo "deb_file=${DEB_FILE}" echo "sha256=${SHA256}"