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)
|
||||
id: debian_upload
|
||||
shell: bash
|
||||
run: |
|
||||
echo "=== Attempting Debian Package Registry upload with ACCESS_TOKEN ==="
|
||||
|
||||
|
|
@ -293,50 +294,51 @@ jobs:
|
|||
# Set output for this step
|
||||
echo "debian_package_ids=${uploaded_debian_ids[*]}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload to Generic Package Registry (Fallback)
|
||||
id: generic_upload
|
||||
run: |
|
||||
echo "=== Attempting Generic Package Registry upload (fallback) with ACCESS_TOKEN ==="
|
||||
|
||||
uploaded_generic_ids=()
|
||||
# - name: Upload to Generic Package Registry (Fallback)
|
||||
# id: generic_upload
|
||||
# shell: bash
|
||||
# run: |
|
||||
# echo "=== Attempting Generic Package Registry upload (fallback) with ACCESS_TOKEN ==="
|
||||
#
|
||||
# uploaded_generic_ids=()
|
||||
|
||||
for deb_file in release-assets/*.deb; do
|
||||
if [ -f "$deb_file" ]; then
|
||||
echo "Uploading $deb_file to Generic Package Registry..."
|
||||
filename=$(basename "$deb_file")
|
||||
package_name=$(echo "$filename" | cut -d'_' -f1)
|
||||
version=$(echo "$filename" | cut -d'_' -f2 | cut -d'~' -f1)
|
||||
|
||||
echo "Package: $package_name"
|
||||
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 }}" \
|
||||
--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')
|
||||
|
||||
echo "HTTP Response Code: $http_code"
|
||||
|
||||
if [ "$http_code" = "201" ]; then
|
||||
echo "✅ Generic Package Registry upload SUCCESS for $deb_file"
|
||||
package_id=$(echo "$response_body" | jq -r '.id' 2>/dev/null)
|
||||
if [ -n "$package_id" ] && [ "$package_id" != "null" ]; then
|
||||
echo "Captured Package ID: $package_id"
|
||||
uploaded_generic_ids+=("$package_id")
|
||||
else
|
||||
echo "Could not extract Package ID from response for $deb_file."
|
||||
fi
|
||||
else
|
||||
echo "❌ Generic Package Registry upload FAILED for $deb_file (HTTP $http_code)"
|
||||
echo "Response body: $response_body"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "generic_package_ids=${uploaded_generic_ids[*]}" >> $GITHUB_OUTPUT
|
||||
# for deb_file in release-assets/*.deb; do
|
||||
# if [ -f "$deb_file" ]; then
|
||||
# echo "Uploading $deb_file to Generic Package Registry..."
|
||||
# filename=$(basename "$deb_file")
|
||||
# package_name=$(echo "$filename" | cut -d'_' -f1)
|
||||
# version=$(echo "$filename" | cut -d'_' -f2 | cut -d'~' -f1)
|
||||
#
|
||||
# echo "Package: $package_name"
|
||||
# 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 }}" \
|
||||
# --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')
|
||||
#
|
||||
# echo "HTTP Response Code: $http_code"
|
||||
#
|
||||
# if [ "$http_code" = "201" ]; then
|
||||
# echo "✅ Generic Package Registry upload SUCCESS for $deb_file"
|
||||
# package_id=$(echo "$response_body" | jq -r '.id' 2>/dev/null)
|
||||
# if [ -n "$package_id" ] && [ "$package_id" != "null" ]; then
|
||||
# echo "Captured Package ID: $package_id"
|
||||
# uploaded_generic_ids+=("$package_id")
|
||||
# else
|
||||
# echo "Could not extract Package ID from response for $deb_file."
|
||||
# fi
|
||||
# else
|
||||
# echo "❌ Generic Package Registry upload FAILED for $deb_file (HTTP $http_code)"
|
||||
# echo "Response body: $response_body"
|
||||
# fi
|
||||
# fi
|
||||
# done
|
||||
# echo "generic_package_ids=${uploaded_generic_ids[*]}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check uploaded packages and provide assignment instructions
|
||||
run: |
|
||||
|
|
@ -369,6 +371,7 @@ jobs:
|
|||
|
||||
- name: Get Repository ID
|
||||
id: get_repo_id
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Fetching repository ID for robojerk/libostree-dev..."
|
||||
REPO_INFO=$(curl -s -H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
||||
|
|
@ -385,12 +388,13 @@ jobs:
|
|||
fi
|
||||
|
||||
- name: Assign Uploaded Packages to Repository
|
||||
shell: bash
|
||||
run: |
|
||||
echo "=== Assigning uploaded packages to repository ==="
|
||||
|
||||
REPO_ID="${{ steps.get_repo_id.outputs.REPO_ID }}"
|
||||
DEBIAN_PACKAGE_IDS="${{ steps.debian_upload.outputs.debian_package_ids }}"
|
||||
GENERIC_PACKAGE_IDS="${{ steps.generic_upload.outputs.generic_package_ids }}"
|
||||
# Convert space-separated strings back to arrays
|
||||
read -ra DEBIAN_PACKAGE_IDS <<< "${{ steps.debian_upload.outputs.debian_package_ids }}"
|
||||
|
||||
if [ -z "$REPO_ID" ]; then
|
||||
echo "Repository ID not found. Cannot assign packages."
|
||||
|
|
@ -398,12 +402,11 @@ jobs:
|
|||
fi
|
||||
|
||||
echo "Repository ID: $REPO_ID"
|
||||
echo "Debian Package IDs: $DEBIAN_PACKAGE_IDS"
|
||||
echo "Generic Package IDs: $GENERIC_PACKAGE_IDS"
|
||||
echo "Debian Package IDs: ${DEBIAN_PACKAGE_IDS[*]}"
|
||||
|
||||
# Process Debian packages
|
||||
if [ -n "$DEBIAN_PACKAGE_IDS" ]; then
|
||||
for package_id in $DEBIAN_PACKAGE_IDS; do
|
||||
if [ ${#DEBIAN_PACKAGE_IDS[@]} -gt 0 ]; then
|
||||
for package_id in "${DEBIAN_PACKAGE_IDS[@]}"; do
|
||||
echo "Assigning Debian package ID $package_id to repo $REPO_ID..."
|
||||
response=$(curl -s -w "%{http_code}" -X POST \
|
||||
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
|
||||
|
|
@ -424,25 +427,4 @@ jobs:
|
|||
echo "No Debian package IDs captured for assignment."
|
||||
fi
|
||||
|
||||
# Process Generic packages
|
||||
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
|
||||
# Generic package processing removed - focusing only on Debian Package Registry
|
||||
Loading…
Add table
Add a link
Reference in a new issue