
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 7s
Build-Test-Publish / build (linux/arm64) (push) Failing after 7s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
35 lines
977 B
Bash
Executable File
35 lines
977 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# Get script directory - handle different execution contexts
|
|
if [ -n "${BASH_SOURCE[0]}" ]; then
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
else
|
|
SCRIPT_DIR="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
|
|
fi
|
|
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
|
|
|
|
|
# Debug output for CI
|
|
echo "${PROJECT} build script running from: ${SCRIPT_DIR}"
|
|
|
|
mkdir -p "${SCRIPT_DIR}/build"
|
|
mkdir -p "${SCRIPT_DIR}/output"
|
|
|
|
cd "${SCRIPT_DIR}" || exit 1
|
|
|
|
# Run build in container with mounted directories
|
|
docker run --rm \
|
|
--user "$(id -u):$(id -g)" \
|
|
-v ".:/app" \
|
|
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
|
bash -c "
|
|
cd /app && ls -la && \
|
|
cmake -G Ninja -S /app -B /app/build \
|
|
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
|
-DPROJECT_NAME=${PROJECT} && \
|
|
cmake --build /app/build && \
|
|
cp /app/build/${PROJECT} /app/output/
|
|
"
|