
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
27 lines
899 B
Bash
Executable File
27 lines
899 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# Get script directory - handle different execution contexts
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
|
|
|
# Debug output for CI
|
|
echo "${PROJECT} build script running from: ${SCRIPT_DIR}"
|
|
|
|
# Run build in container with mounted directories
|
|
COMMAND_TO_RUN="cmake -G Ninja -S . -B ./build \
|
|
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
|
-DPROJECT_NAME=${PROJECT} && \
|
|
cmake --build ./build && \
|
|
cp ./build/${PROJECT} ./output/"
|
|
|
|
echo "Building in new docker container"
|
|
docker run --rm \
|
|
--user "$(id -u):$(id -g)" \
|
|
-v "${SCRIPT_DIR}:/app" \
|
|
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
|
bash -c "cd /app && ${COMMAND_TO_RUN}"
|
|
|
|
echo "Build complete"
|