From 06f4e05de45a8d5b17a9e29728a277a67d38bcc9 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sun, 18 Aug 2024 00:17:35 +0200 Subject: [PATCH] tree: update Signed-off-by: AuxXxilium --- .github/workflows/build.yml | 2 +- .github/workflows/data.yml | 78 +++++++++++++++++++++++++++---------- files/initrd/opt/arc/arc.sh | 5 ++- 3 files changed, 61 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ceeb527c..4d53109c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ on: type: boolean update_version: description: "update min version" - default: "24.08.14" + default: "24.08.18" type: string jobs: diff --git a/.github/workflows/data.yml b/.github/workflows/data.yml index 9bddb544..f20bb700 100644 --- a/.github/workflows/data.yml +++ b/.github/workflows/data.yml @@ -7,6 +7,10 @@ name: Data on: + release: + types: + - created + workflow_dispatch: inputs: push: @@ -20,6 +24,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@main + with: + ref: page - name: Init Env run: | @@ -27,34 +33,64 @@ jobs: git config --global user.name "AuxXxilium" sudo timedatectl set-timezone "Europe/Berlin" - - name: Get models + sudo apt update + sudo apt install -y build-essential libtool pkgconf libzstd-dev liblzma-dev libssl-dev # kmodule dependencies + + - name: Get Release Data for Arc run: | - . scripts/func.sh - models="{" - WORK_PATH="files/p3" - mkdir -p "${WORK_PATH}/configs" - getConfigs "${WORK_PATH}/configs" - for M in $(find "${WORK_PATH}/configs" -maxdepth 1 -name \*.yml 2>/dev/null | sed 's/.*\///; s/\.yml//'); do - models+="\"${M}\":[" - for V in $(yq eval '.productvers | explode(.) | to_entries | map([.key])[] | .[]' "${WORK_PATH}/configs/${M}.yml" 2>/dev/null | sort -r); do - models+="\"${V}\"," - done - models="${models%,}]," - done - models="${models%,}}" - echo "${models}" >docs/models.json - rm -rf "${WORK_PATH}/configs" + REPO="${{ github.server_url }}/${{ github.repository }}" + PRERELEASE="true" + + TAG="" + if [ "${PRERELEASE}" = "true" ]; then + TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep /refs/tags/.*\.zip | sed -r 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1)" + else + LATESTURL="$(curl -skL --connect-timeout 10 -w %{url_effective} -o /dev/null "${REPO}/releases/latest")" + TAG="${LATESTURL##*/}" + fi + [ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}" + rm -f arc-${TAG}.img.zip + STATUS=$(curl -kL --connect-timeout 10 -w "%{http_code}" "${REPO}/releases/download/${TAG}/arc-${TAG}.img.zip" -o "arc-${TAG}.img.zip") + if [ $? -ne 0 -o ${STATUS:-0} -ne 200 ]; then + echo "Download failed" + exit 1 + fi + + unzip arc-${TAG}.img.zip -d "arc" + + export TERM=xterm + + sudo ./localbuild.sh create arc/ws arc/arc.img + if [ $? -ne 0 ]; then + echo "create failed" + exit 1 + fi + + - name: Get data + run: | + pip install -r scripts/requirements.txt + python scripts/func.py getmodels -w "arc/ws" -j "docs/models.json" -x "docs/models.xlsx" + python scripts/func.py getaddons -w "arc/ws" -j "docs/addons.json" -x "docs/addons.xlsx" + python scripts/func.py getmodules -w "arc/ws" -j "docs/modules.json" -x "docs/modules.xlsx" + + - name: Upload to Artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: docs + path: | + docs/*.json + retention-days: 5 - name: Check and Push - if: success() && inputs.push == true + if: success() && (inputs.push == true || github.event.action == 'created') run: | echo "Git push ..." + # git checkout main git pull - status=$(git status -s | grep -E 'docs/models.json' | awk '{printf " %s", $2}') + status=$(git status -s | grep -E "docs" | awk '{printf " %s", $2}') if [ -n "${status}" ]; then git add ${status} git commit -m "data: update $(date +%Y-%m-%d" "%H:%M:%S)" git push -f - fi - - \ No newline at end of file + fi \ No newline at end of file diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index a06ba063..7fcfca69 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -698,9 +698,10 @@ function make() { if [ "${AUTOMATED}" == "false" ] && [ "${VALID}" == "false" ]; then MSG="Failed to get PAT Data.\n" MSG+="Please manually fill in the URL and Hash of PAT.\n" - MSG+="You will find these Data at: https://download.synology.com" + MSG+="You will find these Data at:\n" + MSG+="https://auxxxilium.tech/wiki/arc-loader-arc-loader/url-hash-liste" dialog --backtitle "$(backtitle)" --colors --title "Arc Build" --default-button "OK" \ - --form "${MSG}" 10 110 2 "URL" 1 1 "${PAT_URL}" 1 7 100 0 "HASH" 2 1 "${PAT_HASH}" 2 7 100 0 \ + --form "${MSG}" 10 110 2 "URL" 1 1 "${PAT_URL}" 1 7 100 0 "HASH" 2 1 "${PAT_HASH}" 2 8 100 0 \ 2>"${TMP_PATH}/resp" RET=$? [ ${RET} -eq 0 ] # ok-button