Allow specifying a build arch

Default x86_64
This commit is contained in:
2026-04-25 23:14:15 +02:00
parent 0b9eaed1f6
commit efd9728cd3
+16 -10
View File
@@ -5,6 +5,10 @@ inputs:
pat:
description: "A PAT that allows the actor to write to the packages API endpoint"
required: true
build_arch:
description: Build architecture, default x86_64
required: false
default: x86_64
runs:
using: "composite"
steps:
@@ -22,16 +26,18 @@ runs:
CURLARGS=(-i -s --fail-with-body --user ${{ gitea.actor }}:${{ inputs.pat }})
REPO_NAME=$(basename "${{ gitea.repository }}")
for RPM in $(rpmspec -q --builtrpms --qf '%{nevra} ' $SPECFILE); do
echo Publishing ${RPM##*.}/$RPM.rpm to ${{ gitea.server_url }}
curl "${CURLARGS[@]}" -H "Content-Type: application/octet-stream" --upload-file RPMS/${{ inputs.build_arch }}/${RPM_PARTS[0]}-${RPM_PARTS[1]}.${{ inputs.build_arch }}.rpm ${{ gitea.server_url }}/api/packages/${{ gitea.actor }}/rpm/${{ gitea.actor }}-${DIST}/upload
if [ $? -ne 0 ]; then
echo Publishing failed
exit $?
fi
curl "${CURLARGS[@]}" -X POST ${{ gitea.server_url }}/api/v1/packages/${{ gitea.actor }}/rpm/${RPM_PARTS[0]}/-/link/$REPO_NAME
echo Linked $RPM to $REPO_NAME
echo
IFS=$'\n' RPM_OUTPUTS=( $(rpmspec -q --builtrpms --target=${{ inputs.build_arch }} --qf '%{n};%{evr};%{arch}\n' $SPECFILE) )
for RPM_OUTPUT in ${RPM_OUTPUTS[@]}; do
IFS=';' RPM_PARTS=($RPM_OUTPUT)
echo Publishing ${RPM_PARTS[0]}-${RPM_PARTS[1]}.${RPM_PARTS[2]}.rpm to ${{ gitea.server_url }}
curl "${CURLARGS[@]}" -H "Content-Type: application/octet-stream" --upload-file RPMS/${RPM_PARTS[2]}/${RPM_PARTS[0]}-${RPM_PARTS[1]}.${RPM_PARTS[2]}.rpm ${{ gitea.server_url }}/api/packages/${{ gitea.actor }}/${{ gitea.actor }}-${DIST}/upload
if [ $? -ne 0 ]; then
echo Publishing failed
exit $?
fi
curl "${CURLARGS[@]}" -X POST ${{ gitea.api_url }}/packages/${RPM_PARTS[0]}/-/link/$REPO_NAME
echo Linked $RPM to $REPO_NAME
echo
done
echo "Pushed the following files to the ${{ gitea.server_url }}/${{ gitea.actor }} rpm repository:"