Changed to be more limited to only a package following the same name and

devel
This commit is contained in:
2025-12-02 12:55:59 -05:00
parent 5975c89780
commit cc025c1767

View File

@@ -45,14 +45,30 @@ runs:
- name: Upload package
shell: bash
env:
SPEC_FILE_PATH: ${{ inputs.spec-file-path }}
REPOSITORY_URL: ${{ inputs.repository-url }}
PACKAGE_GROUP: ${{ inputs.package-group }}
REPOSITORY_OWNER: ${{ gitea.repository_owner }}
UPLOAD_USER: ${{ inputs.repository-user }}
UPLOAD_USER_TOKEN: ${{ inputs.repository-user-token }}
run: |
find ./rpmbuild/RPMS/ -name "*.rpm" -type f \
-exec curl \
--user ${UPLOAD_USER}:${UPLOAD_USER_TOKEN} \
--upload-file {} \
${REPOSITORY_URL}/api/packages/${REPOSITORY_OWNER}/rpm/${PACKAGE_GROUP}/upload \;
PACKAGE_NAME=$(basename -s .spec ${SPEC_FILE_PATH})
RPM_PATH="./rpmbuild/RPMS/x86_64"
REGULAR_PACKAGE=$(find ${RPM_PATH} -maxdepth 1 -type f \( -name "${PACKAGE_NAME}*\.rpm" -a ! -name "*-devel*\.rpm" \) | head -1)
DEVEL_PACKAGE=$(find ${RPM_PATH} -maxdepth 1 -type f -name "${PACKAGE_NAME}-devel*\.rpm" | head -1)
if [[ -z "$REGULAR_PACKAGE" ]]; then
echo "Found regular package at ${REGULAR_PACKAGE}, uploading it."
curl --user ${UPLOAD_USER}:${UPLOAD_USER_TOKEN} \
--upload-file ${REGULAR_PACKAGE} \
${REPOSITORY_URL}/api/packages/${REPOSITORY_OWNER}/rpm/${PACKAGE_GROUP}/upload \;
else
echo "No regular package found, skipping..."
fi
if [[ -z "$DEVEL_PACKAGE" ]]; then
echo "Found devel package at ${DEVEL_PACKAGE}, uploading it."
curl --user ${UPLOAD_USER}:${UPLOAD_USER_TOKEN} \
--upload-file ${DEVEL_PACKAGE} \
${REPOSITORY_URL}/api/packages/${REPOSITORY_OWNER}/rpm/${PACKAGE_GROUP}/upload \;
else
echo "No devel package found, skipping..."
fi