From 546d8718d210db2edae64ef767c914f577c60170 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Mon, 25 Jul 2022 15:21:17 +0200 Subject: [PATCH] Reimplement new pipeline and allow limiting number of cores used fo build Co-authored-by: belliash Reviewed-on: https://git.codingworkshop.eu.org/xt-sys/xtchain/pulls/3 Reviewed-by: Piotr Likoski --- .build.yml | 11 ++++++++++- build-linux.sh | 15 ++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.build.yml b/.build.yml index b63e468..8d74cd1 100644 --- a/.build.yml +++ b/.build.yml @@ -2,4 +2,13 @@ pipeline: build: image: codingworkshop/oscw-runner:latest commands: - - sh build-linux.sh + - CORES=10 ./build-linux.sh + publish: + image: codingworkshop/oscw-runner:latest + secrets: + - OSCW_GITHUB_USERNAME + - OSCW_GITHUB_PASSWORD + when: + event: tag + commands: + - github_publish $OSCW_GITHUB_USERNAME $OSCW_GITHUB_PASSWORD $(ls xtchain-*-linux.tar.zst) diff --git a/build-linux.sh b/build-linux.sh index b03ad90..09ca532 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -448,6 +448,7 @@ wine_build() cd ${WINEDIR}/build ../configure \ -enable-win64 \ + --without-freetype \ --without-x for TOOL in winedump wmc wrc; do make -j${CORES} tools/${TOOL}/all @@ -507,16 +508,12 @@ xtchain_build() # Exit immediately on any failure set -e -# Check if script launched as root -if [ "$(whoami)" = "root" ]; then - echo "This script cannot be run as root!" - exit 1 -fi - # Check number of CPU cores available -: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)} -: ${CORES:=$(nproc 2>/dev/null)} -: ${CORES:=1} +if [[ ! -n ${CORES} ]]; then + : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)} + : ${CORES:=$(nproc 2>/dev/null)} + : ${CORES:=1} +fi # Create working directories mkdir -p ${BINDIR}