From a13fce8a9d1c86e4d6a55d0dfe4f789e5e5530e0 Mon Sep 17 00:00:00 2001 From: Carlos Mogas da Silva Date: Sat, 7 Dec 2024 18:30:16 +0000 Subject: [PATCH] Fix RPM paths and final output --- entrypoint.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9928f41..bdc1383 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,6 +10,7 @@ SYSTEM=${INPUT_SYSTEM} ARCH=${INPUT_ARCH} NOCHECK=${INPUT_NOCHECK} +RESULT="rpms=[" for SPEC in ${SPECS[@]}; do SPEC_NAME=$(basename ${SPEC}) @@ -37,22 +38,26 @@ for SPEC in ${SPECS[@]}; do fi echo "::endgroup::" - SRPM=$(grep Wrote result/build.log | cut -d" " -f 2) + SRPM=$(grep Wrote result/build.log | cut -d ":" -f 2 | tr -d " " | xargs basename) echo "::group::Building RPM" OPTS="" - if [ ${NOCHECK,,} == "true"]; then + if [ ${NOCHECK,,} == "true" ]; then OPTS="${OPTS} --nocheck" fi - mock -r "${SYSTEM}-${ARCH}" --resultdir result ${OPTS} ${SRPM} + mock -r "${SYSTEM}-${ARCH}" --resultdir result ${OPTS} result/${SRPM} if [ $? -ne 0 ]; then echo "::error::Failed to build RPM" exit 1 fi echo "::endgroup::" - RPMS=i$(grep Wrote result/build.log | grep "/RPMS/" | cut -d" " -f 2) - echo "::debug::rpms: ${RPMS}" - echo "rpms=${RPMS}" >> ${GITHUB_OUTPUT} + RPMS=$(grep Wrote result/build.log | grep "/RPMS/" | cut -d" " -f 2 | xargs basename) + echo "::debug::built rpm: ${RPMS}" + RESULT="${RESULT},\"${RPMS}\"" cd - done + +RESULT="${RESULT/[,/[}]" +echo "::debug::final built rpms: ${RESULT}" +echo ${RESULT} >> ${GITHUB_OUTPUT}