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}