From 82acdf600afd092eda27f1da92e5460e0232f1c9 Mon Sep 17 00:00:00 2001 From: Sergey Zhemoytel Date: Mon, 6 Jan 2025 17:57:23 +0300 Subject: [PATCH] update deploy --- action.yml | 67 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/action.yml b/action.yml index 5513b13..9998a9f 100644 --- a/action.yml +++ b/action.yml @@ -119,46 +119,45 @@ runs: CI_DEPLOY: ${{ secrets.CI_DEPLOY }} RPMBUILDROOT: /home/builder/rpmbuild run: | - send_package() { - local file=$1 - local arch=$2 - local type=$3 + send_package() { + local file=$1 + local arch=$2 + local type=$3 - if [ "$arch" = "noarch" ]; then - url="${{ github.server_url }}/api/packages/${{ github.repository }}/generic/R11/noarch/${file}" - else - url="${{ github.server_url }}/api/packages/${{ github.repository }}/generic/R11/${arch}/${file}" - fi + if [ "$arch" = "noarch" ]; then + url="${{ github.server_url }}/api/packages/${{ github.repository }}/generic/R11/noarch/${file}" + else + url="${{ github.server_url }}/api/packages/${{ github.repository }}/generic/R11/${arch}/${file}" + fi - if [ "$type" = "srpm" ]; then - url="${{ github.server_url }}/api/packages/${{ github.repository }}/generic/R11/srpms/${file}" - fi + if [ "$type" = "srpm" ]; then + url="${{ github.server_url }}/api/packages/${{ github.repository }}/generic/R11/srpms/${file}" + fi - curl --user ${{ github.repository_owner }}:${CI_DEPLOY} \ - --upload-file "$file" \ - "$url" - } + curl --user ${{ github.repository_owner }}:${CI_DEPLOY} \ + --upload-file "$file" \ + "$url" + } - for dir in SRPMS RPMS/noarch RPMS/*; do - if [ -d "${RPMBUILDROOT}/${dir}" ]; then - for file in "${RPMBUILDROOT}/${dir}"/*.rpm; do - if [ -f "$file" ]; then - if [ "$dir" = "SRPMS" ]; then - arch="noarch" - type="srpm" - elif [ "$dir" = "noarch" ]; then - arch="noarch" - type="rpm" - else - arch=$(basename "${dir}") - type="rpm" - fi - - send_package "$file" "$arch" "$type" + for dir in SRPMS RPMS/noarch RPMS/*; do + if [ -d "${RPMBUILDROOT}/${dir}" ]; then + for file in "${RPMBUILDROOT}/${dir}"/*.rpm; do + if [ -f "$file" ]; then + if [ "$dir" = "SRPMS" ]; then + arch="noarch" + type="srpm" + elif [ "$dir" = "noarch" ]; then + arch="noarch" + type="rpm" + else + arch=$(basename "${dir}") + type="rpm" + fi + send_package "$file" "$arch" "$type" + fi + done fi done - fi - done