Changed to be more limited to only a package following the same name and
devel
This commit is contained in:
24
action.yml
24
action.yml
@@ -45,14 +45,30 @@ runs:
|
|||||||
- name: Upload package
|
- name: Upload package
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
SPEC_FILE_PATH: ${{ inputs.spec-file-path }}
|
||||||
REPOSITORY_URL: ${{ inputs.repository-url }}
|
REPOSITORY_URL: ${{ inputs.repository-url }}
|
||||||
PACKAGE_GROUP: ${{ inputs.package-group }}
|
PACKAGE_GROUP: ${{ inputs.package-group }}
|
||||||
REPOSITORY_OWNER: ${{ gitea.repository_owner }}
|
REPOSITORY_OWNER: ${{ gitea.repository_owner }}
|
||||||
UPLOAD_USER: ${{ inputs.repository-user }}
|
UPLOAD_USER: ${{ inputs.repository-user }}
|
||||||
UPLOAD_USER_TOKEN: ${{ inputs.repository-user-token }}
|
UPLOAD_USER_TOKEN: ${{ inputs.repository-user-token }}
|
||||||
run: |
|
run: |
|
||||||
find ./rpmbuild/RPMS/ -name "*.rpm" -type f \
|
PACKAGE_NAME=$(basename -s .spec ${SPEC_FILE_PATH})
|
||||||
-exec curl \
|
RPM_PATH="./rpmbuild/RPMS/x86_64"
|
||||||
--user ${UPLOAD_USER}:${UPLOAD_USER_TOKEN} \
|
REGULAR_PACKAGE=$(find ${RPM_PATH} -maxdepth 1 -type f \( -name "${PACKAGE_NAME}*\.rpm" -a ! -name "*-devel*\.rpm" \) | head -1)
|
||||||
--upload-file {} \
|
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 \;
|
${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
|
||||||
|
|||||||
Reference in New Issue
Block a user