Update .gitea/workflows/actions.yaml
All checks were successful
build-image / Semantic Release (Dry-run) (push) Successful in 31s
build-image / Build image (push) Successful in 11m25s

This commit is contained in:
2025-11-15 02:17:38 +00:00
parent 77c5a633ed
commit b58831ea56

View File

@@ -60,10 +60,10 @@ jobs:
run: | run: |
curl -L \ curl -L \
https://sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2024.04/ubuntu-24.04-server-cloudimg-amd64.img \ https://sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2024.04/ubuntu-24.04-server-cloudimg-amd64.img \
-o ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img \ -o ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img \
-u ${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }} -u ${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}
qemu-img resize ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img +5G qemu-img resize ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img +5G
- name: Generate seed ISO - name: Generate seed ISO
run: | run: |
envsubst < cloud-init/user-data.template > cloud-init/user-data envsubst < cloud-init/user-data.template > cloud-init/user-data
@@ -86,7 +86,7 @@ jobs:
-m 3072 \ -m 3072 \
-smp 2 \ -smp 2 \
-cpu host \ -cpu host \
-drive file=ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img,if=virtio,format=qcow2 \ -drive file=ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img,if=virtio,format=qcow2 \
-drive file=ubuntu-vm/seed.iso,format=raw,media=cdrom \ -drive file=ubuntu-vm/seed.iso,format=raw,media=cdrom \
-nographic \ -nographic \
-net nic \ -net nic \
@@ -95,15 +95,15 @@ jobs:
-chardev socket,path=qga.sock,server=on,wait=off,id=qga0 \ -chardev socket,path=qga.sock,server=on,wait=off,id=qga0 \
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
if ! guestfish --ro -a ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img -i stat /var/log/template-generation-success; then if ! guestfish --ro -a ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img -i stat /var/log/template-generation-success; then
echo "VM provisioning encountered errors - exiting" echo "VM provisioning encountered errors - exiting"
exit 1 exit 1
fi fi
- name: Compress image file - name: Compress image file
run: | run: |
virt-sparsify --compress \ virt-sparsify --compress \
ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img \ ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img \
ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}-compacted.img ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}-compacted.img
- name: Upload image file - name: Upload image file
run: | run: |
REPO_TOKEN=$(curl -fsSL -X POST \ REPO_TOKEN=$(curl -fsSL -X POST \
@@ -112,9 +112,9 @@ jobs:
-d '{"username": "admin", "password": "${{ secrets.REPO_PASSWORD }}"}' \ -d '{"username": "admin", "password": "${{ secrets.REPO_PASSWORD }}"}' \
) )
curl -fsSL -X POST \ curl -fsSL -X POST \
http://filebrowser.filebrowser.svc.cluster.local:80/api/resources/rel/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img?override=true \ http://filebrowser.filebrowser.svc.cluster.local:80/api/resources/rel/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img?override=true \
--header "X-Auth: $REPO_TOKEN" \ --header "X-Auth: $REPO_TOKEN" \
--upload-file "ubuntu-vm/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}-compacted.img" --upload-file "ubuntu-vm/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}-compacted.img"
curl -ksS -X PUT "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages" \ curl -ksS -X PUT "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages" \
-H "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \ -H "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \
@@ -126,9 +126,9 @@ jobs:
"namespace": "default" "namespace": "default"
}, },
"spec": { "spec": {
"displayName": "ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}", "displayName": "ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}",
"sourceType": "download", "sourceType": "download",
"url": "https://${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}@sn.itch.fyi/Repository/rel/ubuntu-24.04.2-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img" "url": "https://${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}@sn.itch.fyi/Repository/rel/ubuntu-24.04-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img"
} }
} }
EOF EOF