Comment out Generic Package Registry upload and assignment logic
Some checks failed
Build libostree Backport / Build libostree Backport (push) Failing after 10m16s
Some checks failed
Build libostree Backport / Build libostree Backport (push) Failing after 10m16s
This commit is contained in:
parent
459bdfc569
commit
0eeb2857ec
1 changed files with 53 additions and 71 deletions
|
|
@ -250,6 +250,7 @@ jobs:
|
||||||
|
|
||||||
- name: Upload to Debian Package Registry (Primary)
|
- name: Upload to Debian Package Registry (Primary)
|
||||||
id: debian_upload
|
id: debian_upload
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "=== Attempting Debian Package Registry upload with ACCESS_TOKEN ==="
|
echo "=== Attempting Debian Package Registry upload with ACCESS_TOKEN ==="
|
||||||
|
|
||||||
|
|
@ -293,50 +294,51 @@ jobs:
|
||||||
# Set output for this step
|
# Set output for this step
|
||||||
echo "debian_package_ids=${uploaded_debian_ids[*]}" >> $GITHUB_OUTPUT
|
echo "debian_package_ids=${uploaded_debian_ids[*]}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Upload to Generic Package Registry (Fallback)
|
# - name: Upload to Generic Package Registry (Fallback)
|
||||||
id: generic_upload
|
# id: generic_upload
|
||||||
run: |
|
# shell: bash
|
||||||
echo "=== Attempting Generic Package Registry upload (fallback) with ACCESS_TOKEN ==="
|
# run: |
|
||||||
|
# echo "=== Attempting Generic Package Registry upload (fallback) with ACCESS_TOKEN ==="
|
||||||
|
#
|
||||||
|
# uploaded_generic_ids=()
|
||||||
|
|
||||||
uploaded_generic_ids=()
|
# for deb_file in release-assets/*.deb; do
|
||||||
|
# if [ -f "$deb_file" ]; then
|
||||||
for deb_file in release-assets/*.deb; do
|
# echo "Uploading $deb_file to Generic Package Registry..."
|
||||||
if [ -f "$deb_file" ]; then
|
# filename=$(basename "$deb_file")
|
||||||
echo "Uploading $deb_file to Generic Package Registry..."
|
# package_name=$(echo "$filename" | cut -d'_' -f1)
|
||||||
filename=$(basename "$deb_file")
|
# version=$(echo "$filename" | cut -d'_' -f2 | cut -d'~' -f1)
|
||||||
package_name=$(echo "$filename" | cut -d'_' -f1)
|
#
|
||||||
version=$(echo "$filename" | cut -d'_' -f2 | cut -d'~' -f1)
|
# echo "Package: $package_name"
|
||||||
|
# echo "Version: $version"
|
||||||
echo "Package: $package_name"
|
# echo "File: $filename"
|
||||||
echo "Version: $version"
|
#
|
||||||
echo "File: $filename"
|
# # Capture full response (headers + body) to parse HTTP code AND package ID
|
||||||
|
# response_and_code=$(curl -s -i --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
|
||||||
# Capture full response (headers + body) to parse HTTP code AND package ID
|
# --upload-file "$deb_file" \
|
||||||
response_and_code=$(curl -s -i --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
|
# "https://git.raines.xyz/api/packages/robojerk/generic/$package_name/$version/$filename")
|
||||||
--upload-file "$deb_file" \
|
#
|
||||||
"https://git.raines.xyz/api/packages/robojerk/generic/$package_name/$version/$filename")
|
# http_code=$(echo "$response_and_code" | head -n 1 | grep -oP 'HTTP/\d.\d \K\d{3}')
|
||||||
|
# response_body=$(echo "$response_and_code" | awk '/^\r?$/{p=1;next}p')
|
||||||
http_code=$(echo "$response_and_code" | head -n 1 | grep -oP 'HTTP/\d.\d \K\d{3}')
|
#
|
||||||
response_body=$(echo "$response_and_code" | awk '/^\r?$/{p=1;next}p')
|
# echo "HTTP Response Code: $http_code"
|
||||||
|
#
|
||||||
echo "HTTP Response Code: $http_code"
|
# if [ "$http_code" = "201" ]; then
|
||||||
|
# echo "✅ Generic Package Registry upload SUCCESS for $deb_file"
|
||||||
if [ "$http_code" = "201" ]; then
|
# package_id=$(echo "$response_body" | jq -r '.id' 2>/dev/null)
|
||||||
echo "✅ Generic Package Registry upload SUCCESS for $deb_file"
|
# if [ -n "$package_id" ] && [ "$package_id" != "null" ]; then
|
||||||
package_id=$(echo "$response_body" | jq -r '.id' 2>/dev/null)
|
# echo "Captured Package ID: $package_id"
|
||||||
if [ -n "$package_id" ] && [ "$package_id" != "null" ]; then
|
# uploaded_generic_ids+=("$package_id")
|
||||||
echo "Captured Package ID: $package_id"
|
# else
|
||||||
uploaded_generic_ids+=("$package_id")
|
# echo "Could not extract Package ID from response for $deb_file."
|
||||||
else
|
# fi
|
||||||
echo "Could not extract Package ID from response for $deb_file."
|
# else
|
||||||
fi
|
# echo "❌ Generic Package Registry upload FAILED for $deb_file (HTTP $http_code)"
|
||||||
else
|
# echo "Response body: $response_body"
|
||||||
echo "❌ Generic Package Registry upload FAILED for $deb_file (HTTP $http_code)"
|
# fi
|
||||||
echo "Response body: $response_body"
|
# fi
|
||||||
fi
|
# done
|
||||||
fi
|
# echo "generic_package_ids=${uploaded_generic_ids[*]}" >> $GITHUB_OUTPUT
|
||||||
done
|
|
||||||
echo "generic_package_ids=${uploaded_generic_ids[*]}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Check uploaded packages and provide assignment instructions
|
- name: Check uploaded packages and provide assignment instructions
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -369,6 +371,7 @@ jobs:
|
||||||
|
|
||||||
- name: Get Repository ID
|
- name: Get Repository ID
|
||||||
id: get_repo_id
|
id: get_repo_id
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Fetching repository ID for robojerk/libostree-dev..."
|
echo "Fetching repository ID for robojerk/libostree-dev..."
|
||||||
REPO_INFO=$(curl -s -H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
REPO_INFO=$(curl -s -H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
||||||
|
|
@ -385,12 +388,13 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Assign Uploaded Packages to Repository
|
- name: Assign Uploaded Packages to Repository
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "=== Assigning uploaded packages to repository ==="
|
echo "=== Assigning uploaded packages to repository ==="
|
||||||
|
|
||||||
REPO_ID="${{ steps.get_repo_id.outputs.REPO_ID }}"
|
REPO_ID="${{ steps.get_repo_id.outputs.REPO_ID }}"
|
||||||
DEBIAN_PACKAGE_IDS="${{ steps.debian_upload.outputs.debian_package_ids }}"
|
# Convert space-separated strings back to arrays
|
||||||
GENERIC_PACKAGE_IDS="${{ steps.generic_upload.outputs.generic_package_ids }}"
|
read -ra DEBIAN_PACKAGE_IDS <<< "${{ steps.debian_upload.outputs.debian_package_ids }}"
|
||||||
|
|
||||||
if [ -z "$REPO_ID" ]; then
|
if [ -z "$REPO_ID" ]; then
|
||||||
echo "Repository ID not found. Cannot assign packages."
|
echo "Repository ID not found. Cannot assign packages."
|
||||||
|
|
@ -398,12 +402,11 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Repository ID: $REPO_ID"
|
echo "Repository ID: $REPO_ID"
|
||||||
echo "Debian Package IDs: $DEBIAN_PACKAGE_IDS"
|
echo "Debian Package IDs: ${DEBIAN_PACKAGE_IDS[*]}"
|
||||||
echo "Generic Package IDs: $GENERIC_PACKAGE_IDS"
|
|
||||||
|
|
||||||
# Process Debian packages
|
# Process Debian packages
|
||||||
if [ -n "$DEBIAN_PACKAGE_IDS" ]; then
|
if [ ${#DEBIAN_PACKAGE_IDS[@]} -gt 0 ]; then
|
||||||
for package_id in $DEBIAN_PACKAGE_IDS; do
|
for package_id in "${DEBIAN_PACKAGE_IDS[@]}"; do
|
||||||
echo "Assigning Debian package ID $package_id to repo $REPO_ID..."
|
echo "Assigning Debian package ID $package_id to repo $REPO_ID..."
|
||||||
response=$(curl -s -w "%{http_code}" -X POST \
|
response=$(curl -s -w "%{http_code}" -X POST \
|
||||||
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
||||||
|
|
@ -424,25 +427,4 @@ jobs:
|
||||||
echo "No Debian package IDs captured for assignment."
|
echo "No Debian package IDs captured for assignment."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Process Generic packages
|
# Generic package processing removed - focusing only on Debian Package Registry
|
||||||
if [ -n "$GENERIC_PACKAGE_IDS" ]; then
|
|
||||||
for package_id in $GENERIC_PACKAGE_IDS; do
|
|
||||||
echo "Assigning Generic package ID $package_id to repo $REPO_ID..."
|
|
||||||
response=$(curl -s -w "%{http_code}" -X POST \
|
|
||||||
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"id\": $package_id}" \
|
|
||||||
"https://git.raines.xyz/api/v1/packages/robojerk/libostree-dev/attach")
|
|
||||||
|
|
||||||
http_code=$(echo "$response" | tail -c 4)
|
|
||||||
echo "Assignment HTTP Response Code for Generic package $package_id: $http_code"
|
|
||||||
if [ "$http_code" = "200" ] || [ "$http_code" = "204" ]; then
|
|
||||||
echo "✅ Successfully assigned Generic package ID $package_id"
|
|
||||||
else
|
|
||||||
echo "❌ Failed to assign Generic package ID $package_id (HTTP $http_code)"
|
|
||||||
echo "Response: $response"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
|
||||||
echo "No Generic package IDs captured for assignment."
|
|
||||||
fi
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue