From c0a28c3efe566d35ecebf2d49d7317832f1777e7 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sun, 18 Aug 2024 03:05:54 +0200 Subject: [PATCH] custom: update Signed-off-by: AuxXxilium --- .github/workflows/custom.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/custom.yml b/.github/workflows/custom.yml index 5bf54728..83f47f0d 100644 --- a/.github/workflows/custom.yml +++ b/.github/workflows/custom.yml @@ -39,15 +39,17 @@ jobs: MODEL = '' PRODUCTVER = '' ADDONS = '' + MODULES = '' MACSYS = '' - CUSTOMKERNEL = '' + KERNEL = '' FORMAT = '' try: jsonbody = json.loads(issuebody) MODEL = jsonbody.get('model', '') PRODUCTVER = jsonbody.get('version', '') ADDONS = jsonbody.get('addons', '') - CUSTOMKERNEL = jsonbody.get('customkernel', '') + MODULES = jsonbody.get('modules', '') + KERNEL = jsonbody.get('kernel', '') FORMAT = jsonbody.get('format', '') except ValueError as e: pass @@ -55,7 +57,8 @@ jobs: set_output("MODEL", MODEL) set_output("PRODUCTVER", PRODUCTVER) set_output("ADDONS", ADDONS) - set_output("CUSTOMKERNEL", CUSTOMKERNEL) + set_output("MODULES", MODULES) + set_output("KERNEL", KERNEL) set_output("FORMAT", FORMAT) # calculates the version number and push @@ -125,12 +128,18 @@ jobs: fi writeConfigKey "addons" "{}" "${PRESET_CONFIG_FILE}" if [ -n "${{ env.ADDONS }}" ]; then - writeConfigKey "addons" "{}" "${PRESET_CONFIG_FILE}" for A in $(echo "${{ env.ADDONS }}" | tr ',' ' ' | sed 's/\[//g' | sed 's/\]//g'); do VALUE="" writeConfigKey "addons.\"${A}\"" "${VALUE}" "${PRESET_CONFIG_FILE}" done fi + writeConfigKey "modules" "{}" "${PRESET_CONFIG_FILE}" + if [ -n "${{ env.MODULES }}" ]; then + for M in $(echo "${{ env.MODULES }}" | tr ',' ' ' | sed 's/\[//g' | sed 's/\]//g'); do + VALUE="" + writeConfigKey "MODULES.\"${M}\"" "${VALUE}" "${PRESET_CONFIG_FILE}" + done + fi echo "$(cat "${PRESET_CONFIG_FILE}")" echo "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}" >"/tmp/automated" sudo cp -f "/tmp/automated" "/tmp/p3/automated" @@ -156,6 +165,9 @@ jobs: elif [ "${{ env.FORMAT }}" = "vhdx" ]; then echo "Image Converter -> vhdx" qemu-img convert arc.img -O vhdx -o subformat=dynamic arc.vhdx + elif [ "${{ env.FORMAT }}" = "ova" ]; then + echo "Image Converter -> ova" + convertova "arc.img" "arc.ova" fi # Zip image and generate checksum @@ -189,6 +201,13 @@ jobs: echo "Upload failed" exit 1 fi + elif [ "${{ env.FORMAT }}" = "ova" ]; then + zip -9 "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.ova.zip" arc.ova + UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.ova.zip" "https://file.io")" + if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then + echo "Upload failed" + exit 1 + fi fi EMAIL=$(curl -s -H "Authorization: token ${{ secrets.ACTION }}" "https://api.github.com/users/${{ github.event.issue.user.login }}" | jq -r '.email') @@ -291,4 +310,4 @@ jobs: with: actions: 'close-issue' token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} + issue-number: ${{ github.event.issue.number }} \ No newline at end of file