Move debug and API tests to beginning for faster troubleshooting
Some checks failed
Build libostree Backport / Build libostree Backport (push) Failing after 1m42s
Some checks failed
Build libostree Backport / Build libostree Backport (push) Failing after 1m42s
This commit is contained in:
parent
d5e1b3a5c4
commit
41cdbc8808
1 changed files with 77 additions and 41 deletions
|
|
@ -31,6 +31,81 @@ jobs:
|
||||||
cp -r /tmp/libostree-dev/* .
|
cp -r /tmp/libostree-dev/* .
|
||||||
cp -r /tmp/libostree-dev/.* . 2>/dev/null || true
|
cp -r /tmp/libostree-dev/.* . 2>/dev/null || true
|
||||||
|
|
||||||
|
- name: Install curl for early testing
|
||||||
|
run: |
|
||||||
|
apt-get update -y
|
||||||
|
apt-get install -y curl
|
||||||
|
|
||||||
|
- name: Debug - Check automatic token (safe)
|
||||||
|
run: |
|
||||||
|
echo "=== Debugging Automatic Token ==="
|
||||||
|
echo "Token exists: ${{ secrets.FORGEJO_TOKEN != '' }}"
|
||||||
|
echo "Token length: ${#FORGEJO_TOKEN}"
|
||||||
|
echo "Token first 4 chars: $(echo "$FORGEJO_TOKEN" | cut -c1-4)..."
|
||||||
|
echo "Token last 4 chars: ...$(echo "$FORGEJO_TOKEN" | rev | cut -c1-4 | rev)"
|
||||||
|
echo "Environment variable name: FORGEJO_TOKEN"
|
||||||
|
echo "Available secrets:"
|
||||||
|
env | grep -i token || echo "No token env vars found"
|
||||||
|
env:
|
||||||
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
|
|
||||||
|
- name: Test API endpoints
|
||||||
|
run: |
|
||||||
|
echo "=== Testing Forgejo API endpoints with automatic token ==="
|
||||||
|
|
||||||
|
# Test 1: Check if the Debian Package Registry endpoint exists
|
||||||
|
echo "Testing Debian Package Registry endpoint..."
|
||||||
|
curl -v -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
"https://git.raines.xyz/api/v1/repos/robojerk/libostree-dev/packages/debian" 2>&1
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== Testing Generic Package Registry endpoint ==="
|
||||||
|
|
||||||
|
# Test 2: Check if the Generic Package Registry endpoint exists
|
||||||
|
curl -v -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
"https://git.raines.xyz/api/v1/packages/robojerk/generic" 2>&1
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== Testing repository packages endpoint ==="
|
||||||
|
|
||||||
|
# Test 3: Check repository packages endpoint
|
||||||
|
curl -v -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
"https://git.raines.xyz/api/v1/repos/robojerk/libostree-dev/packages" 2>&1
|
||||||
|
|
||||||
|
- name: Test package upload with wget.deb
|
||||||
|
run: |
|
||||||
|
echo "=== Testing package upload with wget.deb ==="
|
||||||
|
|
||||||
|
# Test Debian Package Registry upload
|
||||||
|
echo "Testing Debian Package Registry upload..."
|
||||||
|
response=$(curl -s -w "%{http_code}" -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
--upload-file "wget_1.21.4-1ubuntu4.1_amd64.deb" \
|
||||||
|
"https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload")
|
||||||
|
|
||||||
|
http_code=$(echo "$response" | tail -c 4)
|
||||||
|
echo "Debian Package Registry HTTP Response Code: $http_code"
|
||||||
|
|
||||||
|
if [ "$http_code" = "201" ]; then
|
||||||
|
echo "✅ Debian Package Registry upload SUCCESS"
|
||||||
|
else
|
||||||
|
echo "❌ Debian Package Registry upload FAILED (HTTP $http_code)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Testing Generic Package Registry upload..."
|
||||||
|
response=$(curl -s -w "%{http_code}" -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
--upload-file "wget_1.21.4-1ubuntu4.1_amd64.deb" \
|
||||||
|
"https://git.raines.xyz/api/packages/robojerk/generic/wget/1.21.4-1ubuntu4.1/wget_1.21.4-1ubuntu4.1_amd64.deb")
|
||||||
|
|
||||||
|
http_code=$(echo "$response" | tail -c 4)
|
||||||
|
echo "Generic Package Registry HTTP Response Code: $http_code"
|
||||||
|
|
||||||
|
if [ "$http_code" = "201" ]; then
|
||||||
|
echo "✅ Generic Package Registry upload SUCCESS"
|
||||||
|
else
|
||||||
|
echo "❌ Generic Package Registry upload FAILED (HTTP $http_code)"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Add source repositories
|
- name: Add source repositories
|
||||||
run: |
|
run: |
|
||||||
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ noble main universe" | tee /etc/apt/sources.list.d/noble-sources.list
|
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ noble main universe" | tee /etc/apt/sources.list.d/noble-sources.list
|
||||||
|
|
@ -133,46 +208,7 @@ jobs:
|
||||||
echo "" >> release-assets/INSTALL.md
|
echo "" >> release-assets/INSTALL.md
|
||||||
echo "Build completed on: $(date)" >> release-assets/INSTALL.md
|
echo "Build completed on: $(date)" >> release-assets/INSTALL.md
|
||||||
|
|
||||||
- name: Install curl for package upload
|
|
||||||
run: |
|
|
||||||
apt-get update -y
|
|
||||||
apt-get install -y curl
|
|
||||||
|
|
||||||
- name: Debug - Check automatic token (safe)
|
|
||||||
run: |
|
|
||||||
echo "=== Debugging Automatic Token ==="
|
|
||||||
echo "Token exists: ${{ secrets.FORGEJO_TOKEN != '' }}"
|
|
||||||
echo "Token length: ${#FORGEJO_TOKEN}"
|
|
||||||
echo "Token first 4 chars: $(echo "$FORGEJO_TOKEN" | cut -c1-4)..."
|
|
||||||
echo "Token last 4 chars: ...$(echo "$FORGEJO_TOKEN" | rev | cut -c1-4 | rev)"
|
|
||||||
echo "Environment variable name: FORGEJO_TOKEN"
|
|
||||||
echo "Available secrets:"
|
|
||||||
env | grep -i token || echo "No token env vars found"
|
|
||||||
env:
|
|
||||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
||||||
|
|
||||||
- name: Test API endpoints
|
|
||||||
run: |
|
|
||||||
echo "=== Testing Forgejo API endpoints with automatic token ==="
|
|
||||||
|
|
||||||
# Test 1: Check if the Debian Package Registry endpoint exists
|
|
||||||
echo "Testing Debian Package Registry endpoint..."
|
|
||||||
curl -v -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
|
||||||
"https://git.raines.xyz/api/v1/repos/robojerk/libostree-dev/packages/debian" 2>&1
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "=== Testing Generic Package Registry endpoint ==="
|
|
||||||
|
|
||||||
# Test 2: Check if the Generic Package Registry endpoint exists
|
|
||||||
curl -v -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
|
||||||
"https://git.raines.xyz/api/v1/packages/robojerk/generic" 2>&1
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "=== Testing repository packages endpoint ==="
|
|
||||||
|
|
||||||
# Test 3: Check repository packages endpoint
|
|
||||||
curl -v -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
|
|
||||||
"https://git.raines.xyz/api/v1/repos/robojerk/libostree-dev/packages" 2>&1
|
|
||||||
|
|
||||||
- name: Upload to Debian Package Registry (Primary)
|
- name: Upload to Debian Package Registry (Primary)
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -194,7 +230,7 @@ jobs:
|
||||||
--upload-file "$deb_file" \
|
--upload-file "$deb_file" \
|
||||||
"https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload")
|
"https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload")
|
||||||
|
|
||||||
http_code="${response: -3}"
|
http_code=$(echo "$response" | tail -c 4)
|
||||||
echo "HTTP Response Code: $http_code"
|
echo "HTTP Response Code: $http_code"
|
||||||
|
|
||||||
if [ "$http_code" = "201" ]; then
|
if [ "$http_code" = "201" ]; then
|
||||||
|
|
@ -229,7 +265,7 @@ jobs:
|
||||||
--upload-file "$deb_file" \
|
--upload-file "$deb_file" \
|
||||||
"https://git.raines.xyz/api/packages/robojerk/generic/$package_name/$version/$filename")
|
"https://git.raines.xyz/api/packages/robojerk/generic/$package_name/$version/$filename")
|
||||||
|
|
||||||
http_code="${response: -3}"
|
http_code=$(echo "$response" | tail -c 4)
|
||||||
echo "HTTP Response Code: $http_code"
|
echo "HTTP Response Code: $http_code"
|
||||||
|
|
||||||
if [ "$http_code" = "201" ]; then
|
if [ "$http_code" = "201" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue