build: Configure newly uploaded repository file share link
build-image / Semantic Release (Dry-run) (push) Successful in 33s
build-image / Build image (push) Successful in 12m37s

This commit is contained in:
2026-09-15 23:35:15 +10:00
parent 94755aa890
commit 7f612f8233
+11 -3
View File
@@ -120,6 +120,7 @@ jobs:
-d '{"email": "${{ secrets.REPO_USERNAME }}", "password": "${{ secrets.REPO_PASSWORD }}"}' | \
grep -oP 'connect\.sid=[^;]+' | head -n 1
)
FILE_PATH="${{ steps.compress_image.outputs.image_path }}"
FILE_NAME="$(basename "$FILE_PATH" | sed 's/-compacted//')"
@@ -128,8 +129,15 @@ jobs:
--header "Cookie: $REPO_TOKEN" \
--form "uploadTo=/Storage/Repository/rel" \
--form "filedata=@${FILE_PATH};filename=${FILE_NAME}"
SHARE_URL=$(curl -fsSL -X POST \
http://nextexplorer.nextexplorer.svc.cluster.local:3000/api/shares \
--header "Content-Type: application/json" \
--header "Cookie: $REPO_TOKEN" \
-d '{"sourcePath":"Storage/Repository/rel/${FILE_NAME}"}' | \
jq -r '.directFileUrl'
)
curl -ksS -X PUT "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages" \
curl -ksS -X POST "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages" \
-H "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \
-H "Content-Type: application/json" \
-d @- <<EOF
@@ -139,9 +147,9 @@ jobs:
"namespace": "default"
},
"spec": {
"displayName": "ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}",
"displayName": "$FILE_NAME",
"sourceType": "download",
"url": "https://${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}@sn.itch.fyi/Repository/rel/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img"
"url": "$SHARE_URL?mode=download"
}
}
EOF