Fix RPM paths and final output
All checks were successful
Build docker image / build-and-publish (push) Successful in 5m35s
All checks were successful
Build docker image / build-and-publish (push) Successful in 5m35s
This commit is contained in:
parent
ddc40d0c20
commit
a13fce8a9d
1 changed files with 11 additions and 6 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue