Skip to content

Commit

Permalink
Merge pull request #3074 from AuxXxilium/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
AuxXxilium authored Aug 18, 2024
2 parents 19e5d34 + a8834e0 commit 27ec503
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,26 @@ 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
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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion files/initrd/opt/arc/include/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ function offlineCheck() {
writeConfigKey "arc.nic" "${ARCNIC}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.offline" "${OFFLINE}" "${USER_CONFIG_FILE}"
local BLOCK="$(curl -m 10 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')"
if [ "${BLOCK}" == "ua" ] || [ "${BLOCK}" == "tw" ]; then
if [ "${BLOCK}" == "ua" ]; then
dialog --backtitle "$(backtitle)" --title "Blocked Country" \
--infobox "You are located in a blocked Country and not authorized to use this Loader!" 5 80
rm -rf "${CONFIG_PATH}"
Expand Down

0 comments on commit 27ec503

Please sign in to comment.