This commit is contained in:
@@ -30,46 +30,40 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Doxygen, Graphviz, jq, and doxybook2
|
- name: Install Doxygen, Graphviz, build tools, and build doxybook2 from source
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y doxygen graphviz rsync curl ca-certificates unzip jq
|
sudo apt-get install -y doxygen graphviz rsync curl ca-certificates jq git build-essential cmake pkg-config ninja-build
|
||||||
|
|
||||||
ARCH="$(uname -m)"
|
# Build doxybook2 from source (latest release tag). If API fails, use master.
|
||||||
case "${ARCH}" in
|
TAG="$(curl -fsSL https://api.github.com/repos/matusnovak/doxybook2/releases/latest | jq -r .tag_name || true)"
|
||||||
x86_64|amd64) ARCH_TAG="amd64" ;;
|
if [ -z "${TAG}" ] || [ "${TAG}" = "null" ]; then
|
||||||
aarch64|arm64) ARCH_TAG="arm64" ;;
|
TAG="master"
|
||||||
*) echo "Unsupported architecture: ${ARCH}" >&2; exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Discover latest linux asset for our arch from GitHub API
|
|
||||||
API_URL="https://api.github.com/repos/matusnovak/doxybook2/releases/latest"
|
|
||||||
ASSET_URL="$(curl -fsSL "${API_URL}" \
|
|
||||||
| jq -r --arg arch "${ARCH_TAG}" '.assets[] | select(.name | test("linux-" + $arch + "\\\\.(zip|tar\\\\.gz)$")) | .browser_download_url' \
|
|
||||||
| head -n1)"
|
|
||||||
|
|
||||||
# Fallback to known tar.gz naming if API parsing fails
|
|
||||||
if [ -z "${ASSET_URL}" ] || [ "${ASSET_URL}" = "null" ]; then
|
|
||||||
ASSET_URL="https://github.com/matusnovak/doxybook2/releases/latest/download/doxybook2-linux-${ARCH_TAG}.tar.gz"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TMP="/tmp/doxybook2-asset"
|
rm -rf /tmp/doxybook2
|
||||||
rm -f "${TMP}.zip" "${TMP}.tar.gz" || true
|
git clone --depth 1 --branch "${TAG}" https://github.com/matusnovak/doxybook2.git /tmp/doxybook2
|
||||||
|
git -C /tmp/doxybook2 submodule update --init --recursive || true
|
||||||
|
|
||||||
if echo "${ASSET_URL}" | grep -qi '\.zip$'; then
|
# Prefer Ninja if available, fall back to Makefiles
|
||||||
curl -fsSL -o "${TMP}.zip" "${ASSET_URL}"
|
cmake -S /tmp/doxybook2 -B /tmp/doxybook2/build -G "Ninja" -DCMAKE_BUILD_TYPE=Release || \
|
||||||
sudo unzip -j -o "${TMP}.zip" -d /usr/local/bin doxybook2
|
cmake -S /tmp/doxybook2 -B /tmp/doxybook2/build -DCMAKE_BUILD_TYPE=Release
|
||||||
elif echo "${ASSET_URL}" | grep -qi '\.tar\.gz$'; then
|
cmake --build /tmp/doxybook2/build -j"$(nproc)"
|
||||||
curl -fsSL -o "${TMP}.tar.gz" "${ASSET_URL}"
|
|
||||||
sudo tar -xzf "${TMP}.tar.gz" -C /usr/local/bin doxybook2
|
# Install to /usr/local/bin; prefer CMake install, fallback to manual install
|
||||||
|
if sudo cmake --install /tmp/doxybook2/build 2>/dev/null; then
|
||||||
|
:
|
||||||
else
|
else
|
||||||
echo "Unsupported asset type URL: ${ASSET_URL}" >&2
|
BIN="$(find /tmp/doxybook2/build -type f -executable -name doxybook2 -print -quit)"
|
||||||
exit 1
|
if [ -z "${BIN}" ]; then
|
||||||
|
echo "doxybook2 binary not found in build output" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sudo install -m 0755 "${BIN}" /usr/local/bin/doxybook2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo chmod +x /usr/local/bin/doxybook2
|
|
||||||
doxybook2 --version
|
doxybook2 --version
|
||||||
|
|
||||||
- name: Build Doxygen (HTML + XML)
|
- name: Build Doxygen (HTML + XML)
|
||||||
|
|||||||
Reference in New Issue
Block a user