Fix inputs definition

This commit is contained in:
2025-11-28 01:16:46 +01:00
parent adef41a681
commit e3779f9a1a
+13 -18
View File
@@ -1,19 +1,19 @@
name: "Build rpm packages on COPR"
description: "Build a src package and push it to a copr build."
author: "Daniel Demus"
inputs:
copr_project:
description: The name of the project to build
required: true
specfile:
description: The filename of the spec file to build. If not set and there is only 1 specfile, it will be selected automatically.
required: false
runs:
using: "composite"
steps:
- id: entrypoint
name: Clone source
shell: bash
inputs:
copr_project:
description: The name of the project to build
required: true
specfile:
description: The filename of the spec file to build. If not set and there is only 1 specfile, it will be selected automatically.
required: false
run: |
set -e
@@ -24,21 +24,16 @@ runs:
EOF
cd ${{ gitea.workspace }}
pwd
ls -Al
SPECFILE=$([ "${{ inputs.specfile }}" ] && echo -n "${{ inputs.specfile }}" || echo -n $([ $(ls -1 *.spec 2>/dev/null| wc -l) -eq 1 ] && echo -n "$(ls -1 *.spec)"))
[ "$SPECFILE" == "" ] && exit 1
echo install_weak_deps=false >> /etc/dnf/dnf.conf
echo Downloading source archive
spectool -g $SPECFILE
microdnf builddep -y $SPECFILE
echo Checking for missing builddeps
counter=1
until rpmbuild --define "_sourcedir $PWD" --define "_topdir $PWD" -bd $SPECFILE || [ $counter -gt 5 ]; do
echo Installing missing builddeps round $counter
microdnf builddep -y SRPMS/$(rpmspec -q --srpm --qf '%{nevr}' $SPECFILE).buildreqs.nosrc.rpm
((counter++))
done
fedpkg copr-build ${{ inputs.copr_project }}
echo Build started
rpmbuild -bs --define "_sourcedir $PWD" --define "_topdir $PWD" --define "_rpmdir $PWD" $SPECFILE
copr-cli build ${{ inputs.copr_project }} SRPMS/*
branding:
icon: "package"
color: "gray-dark"