From f3e6868800c35f72bc2482f9fd1726a690b02a9e Mon Sep 17 00:00:00 2001 From: Azathothas Date: Sat, 11 Jan 2025 17:53:47 +0545 Subject: [PATCH] sync --- .github/workflows/build_aarch64_Linux.yaml | 290 ++++++++++++++++----- scripts/runner/setup_aarch64-Linux.sh | 48 ++-- scripts/runner/setup_x86_64-Linux.sh | 48 ++-- 3 files changed, 266 insertions(+), 120 deletions(-) diff --git a/.github/workflows/build_aarch64_Linux.yaml b/.github/workflows/build_aarch64_Linux.yaml index d98edd01..b3c4e6e7 100644 --- a/.github/workflows/build_aarch64_Linux.yaml +++ b/.github/workflows/build_aarch64_Linux.yaml @@ -1,16 +1,16 @@ -name: 🛍ī¸ Build 📀 (toolpack_aarch64-Linux) Packages đŸ“Ļ📀 - +name: 🛍ī¸ Build 📀 (Pkgcache-aarch64-Linux) Packages đŸ“Ļ📀 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + on: workflow_dispatch: - schedule: - - cron: "0 6 * * 4" # @ 06:00 AM UTC (11:45 AM NPT Morning Thu) -#Sane env + #schedule: + # - cron: "30 18 * * 1" # 06:30 PM UTC (12:15 AM NPT Mrng Every Tuesday) env: - GITHUB_TOKEN: "${{ secrets.TOOLPACKS_GHRO }}" - GITLAB_TOKEN: "${{ secrets.TOOLPACKS_GLRO }}" - HF_TOKEN: "${{ secrets.TOOLPACKS_HFRO }}" - RCLONE_CF_R2_PUB: "${{ secrets.RCLONE_CF_R2_PUB }}" - R2_PUB_REPO: "https://pub.ajam.dev/repos/pkgforge/pkgcache" + FORCE_REBUILD_ALL: "NO" #YES--> Force Rebuild everything, will take several tries & fail several times + KEEP_LOGS: "NO" #YES--> Keeps Dirs & Files + NOTIFY_DISCORD: "NO" #NO--> Don't send Notifications to Discord jobs: #------------------------------------------------------------------------------------# presetup: @@ -31,7 +31,8 @@ jobs: #presets set -x ; set +e #-------------# - bash <(curl -qfsSL "https://pub.ajam.dev/repos/Azathothas/Arsenal/misc/Linux/install_dev_tools.sh") + #bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") + sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/rclone" -o "/usr/local/bin/rclone" && sudo chmod +x "/usr/local/bin/rclone" continue-on-error: true #------------------------------------------------------------------------------------# - name: Setup Env @@ -61,6 +62,20 @@ jobs: echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" continue-on-error: true + - name: Sanity Check + run: | + # Presets + set +x ; set +e + #--------------# + pushd "$(mktemp -d)" >/dev/null 2>&1 + PKG_COUNT="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/SBUILD_LIST.json" | jq -r '.[] | .pkg_family' | wc -l | tr -d '[:space:]')" + if [[ "${PKG_COUNT}" -le 10 ]]; then + echo -e "\n[+] FATAL: Too few Packages to Build\n" + exit 1 + fi + popd >/dev/null 2>&1 + continue-on-error: false + - name: Set TZ to (Asia/Kathmandu) run: | # Presets @@ -71,7 +86,7 @@ jobs: sudo dpkg-reconfigure --frontend noninteractive tzdata sudo apt-get install apt-utils software-properties-common -y sudo apt-get update -y - continue-on-error: true + continue-on-error: true #------------------------------------------------------------------------------------# - name: rClone BackUp Repo ("https://pub.ajam.dev/repos/${GITHUB_REPOSITORY}") run: | @@ -79,7 +94,7 @@ jobs: set +x ; set +e #--------------# #copy & chdir to Repo - cp -r "${GITHUB_WORKSPACE}/main" "${SYSTMP}/REPO" && cd "${SYSTMP}/REPO" + cp -fr "${GITHUB_WORKSPACE}/main" "${SYSTMP}/REPO" && cd "${SYSTMP}/REPO" #Git pull git pull origin main --no-edit 2>/dev/null #Del Bloat @@ -87,14 +102,6 @@ jobs: #Upload to Pub echo -e "[+] Syncing ${GITHUB_REPOSITORY} to pub.ajam.dev/repos/${GITHUB_REPOSITORY} \n" rclone sync "." "r2:/pub/repos/${GITHUB_REPOSITORY}/" --user-agent="${USER_AGENT}" --buffer-size="10M" --s3-upload-concurrency="50" --s3-chunk-size="10M" --multi-thread-streams="50" --checkers="2000" --transfers="100" --retries="10" --check-first --checksum --copy-links --fast-list --progress - ##Scripts_aarch64-Linux - #Get JQ Module to convert size : https://users.aalto.fi/~tontti/posts/jq-and-human-readable-bytes/ - curl -qfsSL "https://pub.ajam.dev/utils/devscripts/jq/to_human_bytes.jq" -o "./to_human_bytes.jq" - rclone lsjson --fast-list "r2:/pub/repos/pkgforge/pkgcache/.github/scripts/aarch64-Linux/bins/" --exclude="*.yaml" | jq -r 'include "./to_human_bytes" ; .[] | select(.IsDir == false) | {name: (.Name), update_date: (.ModTime | split(".")[0]), source_url: "https://pub.ajam.dev/repos/pkgforge/pkgcache/.github/scripts/aarch64-Linux/bins/\(.Path)"}' | jq . > "./metadata.json.tmp" - #Clean Pretty Formatted - echo "[" $(cat metadata.json.tmp | tr '\n' ' ' | sed 's/}/},/g' | sed '$ s/,$//') "]" | sed '$s/,[[:space:]]*\]/\]/' | jq . | tee "./metadata.json" - #Update Metadata - rclone copyto --checksum "./metadata.json" "r2:/pub/repos/pkgforge/pkgcache/.github/scripts/aarch64-Linux/bins/metadata.json" continue-on-error: true #------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------# @@ -102,9 +109,12 @@ jobs: #runs-on: ubuntu-latest runs-on: arm64-linux-pkgcache needs: [presetup] - timeout-minutes: 2400 + timeout-minutes: 3200 permissions: + attestations: write contents: write + id-token: write + packages: write steps: - name: Checkout repository @@ -113,13 +123,13 @@ jobs: path: main filter: "blob:none" - - name: Install Addons - run: | - #presets - set -x ; set +e - #-------------# - bash <(curl -qfsSL "https://pub.ajam.dev/repos/Azathothas/Arsenal/misc/Linux/install_dev_tools.sh") - continue-on-error: true + #- name: Install Addons + # run: | + # #presets + # set -x ; set +e + # #-------------# + # bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") + # continue-on-error: true #------------------------------------------------------------------------------------# - name: Setup Env run: | @@ -140,74 +150,210 @@ jobs: mkdir -p "${HOME}/bin" sudo apt update -y sudo apt install dos2unix -y + ##Setup Minisign + mkdir -pv "${HOME}/.minisign" + echo "${{ secrets.MINISIGN_SIGKEY }}" > "${HOME}/.minisign/pkgforge.key" ##Setup rClone - mkdir -p "${HOME}/.config/rclone" - echo "${{ secrets.RCLONE_CF_R2_PUB }}" > "${HOME}/.config/rclone/rclone.conf" + mkdir -pv "${HOME}/.config/rclone" + echo "${{ secrets.CF_META }}" > "${HOME}/.config/rclone/rclone.conf" ##User-Agent USER_AGENT="$(curl -qfsSL 'https://pub.ajam.dev/repos/Azathothas/Wordlists/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" continue-on-error: true - - name: Set TZ to (Asia/Kathmandu) + - name: Cache Container Images run: | - # Presets + ##presets set +x ; set +e - #--------------# - sudo apt-get update -y && sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata - sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime" - sudo dpkg-reconfigure --frontend noninteractive tzdata - sudo apt-get install apt-utils software-properties-common -y - sudo apt-get update -y + #-------------# + for img in "ghcr.io/pkgforge/devscripts/alpine-builder:latest" "ghcr.io/pkgforge/devscripts/alpine-builder-mimalloc:stable" "ghcr.io/pkgforge/devscripts/archlinux-builder:latest" "ghcr.io/pkgforge/devscripts/debian-builder-unstable:latest" "ghcr.io/pkgforge/devscripts/ubuntu-builder:latest"; do docker pull $img & done; wait continue-on-error: true + + - name: Notify (Discord) [Trigger] + if: env.NOTIFY_DISCORD != 'NO' + run: | + ##presets + set +x ; set +e + #-------------# + pushd "$(mktemp -d)" >/dev/null 2>&1 + #Setup Config + sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" + echo 'discord:' > "./notify.yaml" + echo ' - id: "portable-apps"' >> "./notify.yaml" + echo ' discord_channel: "main"' >> "./notify.yaml" + echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" + echo ' discord_format: "{{data}}"' >> "./notify.yaml" + echo " discord_webhook_url: \"${{ secrets.DISCORD_NOTIFY }}\"" >> "./notify.yaml" + #Prep Body + GH_EVENT="${{ github.event_name }}" + GH_WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" + START_TIME="$(date +%s)" && export START_TIME + echo "GH_EVENT=${GH_EVENT}" >> "${GITHUB_ENV}" + echo "GH_WORKFLOW_URL=${GH_WORKFLOW_URL}" >> "${GITHUB_ENV}" + echo "START_TIME=${START_TIME}" >> "${GITHUB_ENV}" + GH_RECIPE_COUNT="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/SBUILD_LIST.json" | jq -r '.[].pkg_family' | sort -u | wc -l | tr -d '[:space:]')" + echo "GH_RECIPE_COUNT=${GH_RECIPE_COUNT}" >> "${GITHUB_ENV}" + GH_DISABLED_COUNT="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/SBUILD_LIST.json" | jq -r '.[]._disabled' | grep -Ei 'true' | wc -l | tr -d '[:space:]')" + echo "GH_DISABLED_COUNT=${GH_DISABLED_COUNT}" >> "${GITHUB_ENV}" + GH_REBUILD_COUNT="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/SBUILD_LIST.json" | jq -r '.[].rebuild' | grep -Ei 'true' | wc -l | tr -d '[:space:]')" + echo "GH_REBUILD_COUNT=${GH_REBUILD_COUNT}" >> "${GITHUB_ENV}" + rm -rvf "/tmp/PKGFORGE_DISCORD.md" 2>/dev/null + echo 'ℹī¸ **Triggered** [🛍ī¸ Build đŸ“Ļ Pkgcache] (Weekly) ==> https://github.com/pkgforge/pkgcache/blob/main/.github/workflows/build_aarch64_Linux.yaml `['"$(date --utc +'%Y-%m-%dT%H:%M:%S.%3N')"' UTC]`' > "/tmp/PKGFORGE_DISCORD.md" + echo '**`Host`**: `aarch64-Linux`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Event`**: `'"${GH_EVENT}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + #echo '**`Workflow`**: "'${GH_WORKFLOW_URL}'"' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Workflow`**: '${GH_WORKFLOW_URL}' ' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Maintainer`**: @Azathothas' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Packages (pkg_family)`**: `'"Total: ${GH_RECIPE_COUNT} (Disabled: ${GH_DISABLED_COUNT}) (Rebuilt: ${GH_REBUILD_COUNT})"'`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Preserving TMPFILES?`**: `'"${KEEP_LOGS}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Rebuilding?`**: `'"${FORCE_REBUILD_ALL}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check + echo -e "\n\n" && cat "/tmp/PKGFORGE_DISCORD.md" && echo -e "\n\n" + popd >/dev/null 2>&1 + continue-on-error: true + + #- name: Set TZ to (Asia/Kathmandu) + # run: | + # # Presets + # set +x ; set +e + # #--------------# + # sudo apt-get update -y && sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata + # sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime" + # sudo dpkg-reconfigure --frontend noninteractive tzdata + # sudo apt-get install apt-utils software-properties-common -y + # sudo apt-get update -y + # continue-on-error: true #------------------------------------------------------------------------------------# #Main Build Script - name: BUILD + env: + #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" #Needs Actions' Token if we want to make the packages public + GHCR_TOKEN: "${{ github.token }}" + GITHUB_TOKEN: "${{ secrets.RO_GHTOKEN }}" + GITLAB_TOKEN: "${{ secrets.RO_GLTOKEN }}" + MINISIGN_KEY: "${{ secrets.MINISIGN_KEY }}" run: | #Presets set +x ; set +e #--------------# ##Main - curl -qfsSL "https://pub.ajam.dev/repos/pkgforge/pkgcache/.github/scripts/aarch64-Linux/build_debian.sh" -o "${SYSTMP}/BUILD.sh" - dos2unix --quiet "${SYSTMP}/BUILD.sh" ; chmod +xwr "${SYSTMP}/BUILD.sh" - ##Run with STDOUT [Slow, Not Recommended] - #bash "${SYSTMP}/BUILD.sh" - ##Run with LOGS only - #bash "${SYSTMP}/BUILD.sh" > "${SYSTMP}/BUILD.log" 2>&1 - ##Run with STDOUT + LOGS - bash "${SYSTMP}/BUILD.sh" | tee "${SYSTMP}/BUILD.log" 2>&1 - ##Run without STDOUT/Logs - #bash "${SYSTMP}/BUILD.sh" >/dev/null 2>&1 - if [[ -f "${SYSTMP}/BUILD.log" ]] && [[ $(stat -c%s "${SYSTMP}/BUILD.log") -gt 1024 ]]; then - ##Purge Tokens (in case set -x & gh didn't redact) - cat "${SYSTMP}/BUILD.log" | ansi2txt > "${SYSTMP}/BUILD.gh.log.txt" - sed -i '/.*github_pat.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - sed -i '/.*ghp_.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - sed -i '/.*access_key_id.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - sed -i '/.*secret_access_key.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - sed -i '/.*cloudflarestorage.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null - cat "${SYSTMP}/BUILD.gh.log.txt" > "${SYSTMP}/BUILD.log" - if grep -iq "completed" "${SYSTMP}/BUILD.gh.log.txt"; then - mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD.log" - elif grep -iq "initializing" "${SYSTMP}/BUILD.gh.log.txt"; then - mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD_FAILED.log" - fi - ##rClone Upload logs - rclone copyto "${SYSTMP}/BUILD.log" "r2:/pub/repos/pkgforge/pkgcache/aarch64-Linux/BUILD.gh.log.txt" --user-agent="${USER_AGENT}" --buffer-size="100M" --s3-upload-concurrency="500" --s3-chunk-size="100M" --multi-thread-streams="500" --checkers="2000" --transfers="1000" --retries="10" --check-first --checksum --copy-links --fast-list --progress - rclone copyto "${SYSTMP}/BUILD_FAILED.log" "r2:/pub/repos/pkgforge/pkgcache/aarch64-Linux/BUILD_FAILED.gh.log.txt" --user-agent="${USER_AGENT}" --buffer-size="100M" --s3-upload-concurrency="500" --s3-chunk-size="100M" --multi-thread-streams="500" --checkers="2000" --transfers="1000" --retries="10" --check-first --checksum --copy-links --fast-list --progress - fi + pushd "$(mktemp -d)" >/dev/null 2>&1 + curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/runner/builder.sh" -o "${SYSTMP}/BUILDER.sh" + dos2unix --quiet "${SYSTMP}/BUILDER.sh" ; chmod +xwr "${SYSTMP}/BUILDER.sh" + ##Run with STDOUT [Slow, Not Recommended] + #bash "${SYSTMP}/BUILDER.sh" + ##Run with LOGS only + #bash "${SYSTMP}/BUILDER.sh" > "${SYSTMP}/BUILD.log" 2>&1 + ##Run with STDOUT + LOGS + bash "${SYSTMP}/BUILDER.sh" | tee "${SYSTMP}/BUILD.log" 2>&1 + ##Run without STDOUT/Logs + #bash "${SYSTMP}/BUILDER.sh" >/dev/null 2>&1 + if [[ -f "${SYSTMP}/BUILD.log" ]] && [[ $(stat -c%s "${SYSTMP}/BUILD.log") -gt 1024 ]]; then + ##Purge Tokens (in case set -x & gh didn't redact) + cat "${SYSTMP}/BUILD.log" | ansi2txt > "${SYSTMP}/BUILD.gh.log.txt" + sed -i '/.*github_pat.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + sed -i '/.*ghp_.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + sed -i '/.*access_key_id.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + sed -i '/.*secret_access_key.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + sed -i '/.*cloudflarestorage.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null + ##Fetch Only Relevant Logs + if grep -iq "completed" "${SYSTMP}/BUILD.gh.log.txt"; then + mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD.log" + elif grep -iq "initializing" "${SYSTMP}/BUILD.gh.log.txt"; then + mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD_FAILED.log" + BUILD_FAILED="YES" + echo "BUILD_FAILED=${BUILD_FAILED}" >> "${GITHUB_ENV}" + fi + ##rClone Upload logs + 7z a -t7z -mx=9 -mmt="$(($(nproc)+1))" -bsp1 -bt "./aarch64-Linux.${{ github.run_id }}.log.xz" "${SYSTMP}/BUILD.log" 2>/dev/null + rclone copyto "./aarch64-Linux.${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/aarch64-Linux.latest.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" & + rclone copyto "./aarch64-Linux.${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/aarch64-linux.latest.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" & + rclone copyto "./aarch64-Linux.${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/aarch64-Linux.${{ github.run_id }}.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" & + if [[ -s "${SYSTMP}/BUILD_FAILED.log" && $(stat -c%s "${SYSTMP}/BUILD_FAILED.log") -gt 10 ]]; then + 7z a -t7z -mx=9 -mmt="$(($(nproc)+1))" -bsp1 -bt "./aarch64-Linux.${{ github.run_id }}.FAILED.log.xz" "${SYSTMP}/BUILD_FAILED.log" 2>/dev/null + rclone copyto "./aarch64-Linux.${{ github.run_id }}.FAILED.log.xz" "r2:/meta/pkgcache/logs/aarch64-Linux.${{ github.run_id }}.FAILED.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" + fi + wait ; echo + fi + popd >/dev/null 2>&1 continue-on-error: true #------------------------------------------------------------------------------------# - #Logs & Artifacts + ##Logs & Artifacts + - name: Get DateTime + run: | + #Presets + set +x ; set +e + #--------------# + UTC_TIME="$(TZ='UTC' date +'%Y_%m_%dT%I_%M_%S_%p')" + echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}" + continue-on-error: true + - name: Upload (aarch64-Linux) Artifacts uses: actions/upload-artifact@v4 with: - name: Toolpack_aarch64-Linux + name: Pkgcache_aarch64-Linux path: | /tmp/BUILD.log compression-level: 0 # no compression, [Default: 6 (GNU Gzip)] - retention-days: 7 + retention-days: 30 overwrite: true continue-on-error: true + + - name: Attest Build Provenance + uses: actions/attest-build-provenance@v2.1.0 + with: + subject-name: "build-logs-aarch64-Linux-${{ env.UTC_TIME }}" + subject-path: "/tmp/BUILD.log" + show-summary: true + continue-on-error: true #------------------------------------------------------------------------------------# + - name: Notify Discord [Completion] + if: env.NOTIFY_DISCORD != 'NO' + run: | + ##presets + set +x ; set +e + #-------------# + pushd "$(mktemp -d)" >/dev/null 2>&1 + #Setup Config + sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" + echo 'discord:' > "./notify.yaml" + echo ' - id: "portable-apps"' >> "./notify.yaml" + echo ' discord_channel: "main"' >> "./notify.yaml" + echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" + echo ' discord_format: "{{data}}"' >> "./notify.yaml" + echo " discord_webhook_url: \"${{ secrets.DISCORD_NOTIFY }}\"" >> "./notify.yaml" + #Prep Body + ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" + END_TIME="$(date +%s)" && export END_TIME="${END_TIME}" + SECS="$((END_TIME - START_TIME))" + #ELAPSED_TIME="$(date -u -d@"$((END_TIME - START_TIME))" "+%H(Hr):%M(Min):%S(Sec)")" + ELAPSED_TIME="$((SECS/86400))(Day):$(date -u -d@$((SECS%86400)) '+%H(Hr):%M(Min):%S(Sec)')" + echo "ELAPSED_TIME=${ELAPSED_TIME}" >> "${GITHUB_ENV}" + rm -rvf "/tmp/PKGFORGE_DISCORD.md" 2>/dev/null + echo 'ℹī¸ **Completed** [🛍ī¸ Build đŸ“Ļ Pkgcache] (Weekly) ==> https://github.com/pkgforge/pkgcache/blob/main/.github/workflows/build_aarch64_Linux.yaml `['"$(date --utc +'%Y-%m-%dT%H:%M:%S.%3N')"' UTC]`' > "/tmp/PKGFORGE_DISCORD.md" + echo '**`Host`**: `aarch64-Linux`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Event`**: `'"${GH_EVENT}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Logs (VERBOSE)`**: https://bin.pkgforge.dev/aarch64-Linux/BUILD.log.txt' >> "/tmp/PKGFORGE_DISCORD.md" + if [[ "${BUILD_FAILED}" == "YES" ]]; then + echo '**`Logs (FAILED)`**: https://bin.pkgforge.dev/aarch64-Linux/BUILD_FAILED.log.txt' >> "/tmp/PKGFORGE_DISCORD.md" + fi + #echo '**`Workflow`**: "'${GH_WORKFLOW_URL}'"' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Workflow`**: '${GH_WORKFLOW_URL}' ' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Maintainer`**: @Azathothas' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Packages (pkg_family)`**: `'"Total: ${GH_RECIPE_COUNT} (Disabled: ${GH_DISABLED_COUNT}) (Rebuilt: ${GH_REBUILD_COUNT})"'`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Packages (Make these PUBLIC)`**: https://github.com/orgs/pkgforge/packages?visibility=private' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Preserved TMPFILES?`**: `'"${KEEP_LOGS}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Rebuilt?`**: `'"${FORCE_REBUILD_ALL}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + echo '**`Total Time`**: `'"${ELAPSED_TIME}"'`' >> "/tmp/PKGFORGE_DISCORD.md" + cat "${SYSTMP}/BUILD.log" | grep -i 'FATAL' | sed -E 's/.*Could NOT Build ([a-z0-9]*\.static).*?(https.*\.yaml\])/\1 [\2/' > "./FAILED.txt" + if [[ -s "./FAILED.txt" && $(stat -c%s "./FAILED.txt") -gt 10 ]]; then + echo '**`Failed Builds`**: ==>' >> "/tmp/PKGFORGE_DISCORD.md" + cat "./FAILED.txt" >> "/tmp/PKGFORGE_DISCORD.md" + fi + cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check + echo -e "\n\n" && cat "/tmp/PKGFORGE_DISCORD.md" && echo -e "\n\n" + popd >/dev/null 2>&1 + continue-on-error: true +#------------------------------------------------------------------------------------# \ No newline at end of file diff --git a/scripts/runner/setup_aarch64-Linux.sh b/scripts/runner/setup_aarch64-Linux.sh index cb200dad..501e3101 100644 --- a/scripts/runner/setup_aarch64-Linux.sh +++ b/scripts/runner/setup_aarch64-Linux.sh @@ -300,30 +300,30 @@ if [ "${CONTINUE}" == "YES" ]; then sudo ldconfig && sudo ldconfig -p fi #----------------------# - ##Install Guix: https://guix.gnu.org/manual/en/html_node/Installation.html - curl -qfsSL "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh" -o "./guix-install.sh" - if [[ ! -s "./guix-install.sh" || $(stat -c%s "./guix-install.sh") -le 10 ]]; then - curl -qfsSL "https://raw.githubusercontent.com/Millak/guix/refs/heads/master/etc/guix-install.sh" -o "./guix-install.sh" - fi - chmod +x "./guix-install.sh" && yes '' | sudo "./guix-install.sh" --uninstall 2>/dev/null - yes '' | sudo "./guix-install.sh" - #Test - if ! command -v guix &> /dev/null; then - echo -e "\n[-] guix NOT Found\n" - export CONTINUE="NO" - return 1 || exit 1 - else - yes '' | guix install glibc-locales - export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale" - curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/nonguix.channels.scm" | sudo tee "/root/.config/guix/channels.scm" - GUIX_GIT_REPO="https://git.savannah.gnu.org/git/guix.git" - ##mirror - #GUIX_GIT_REPO="https://github.com/Millak/guix" - GUIX_LATEST_SHA="$(git ls-remote "${GUIX_GIT_REPO}" 'HEAD' | grep -w 'HEAD' | head -n 1 | awk '{print $1}' | tr -d '[:space:]')" - GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & - sudo GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & - wait ; guix --version - fi + ###Install Guix: https://guix.gnu.org/manual/en/html_node/Installation.html + # curl -qfsSL "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh" -o "./guix-install.sh" + # if [[ ! -s "./guix-install.sh" || $(stat -c%s "./guix-install.sh") -le 10 ]]; then + # curl -qfsSL "https://raw.githubusercontent.com/Millak/guix/refs/heads/master/etc/guix-install.sh" -o "./guix-install.sh" + # fi + # chmod +x "./guix-install.sh" && yes '' | sudo "./guix-install.sh" --uninstall 2>/dev/null + # yes '' | sudo "./guix-install.sh" + # #Test + # if ! command -v guix &> /dev/null; then + # echo -e "\n[-] guix NOT Found\n" + # export CONTINUE="NO" + # return 1 || exit 1 + # else + # yes '' | guix install glibc-locales + # export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale" + # curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/nonguix.channels.scm" | sudo tee "/root/.config/guix/channels.scm" + # GUIX_GIT_REPO="https://git.savannah.gnu.org/git/guix.git" + # ##mirror + # #GUIX_GIT_REPO="https://github.com/Millak/guix" + # GUIX_LATEST_SHA="$(git ls-remote "${GUIX_GIT_REPO}" 'HEAD' | grep -w 'HEAD' | head -n 1 | awk '{print $1}' | tr -d '[:space:]')" + # GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & + # sudo GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & + # wait ; guix --version + # fi #------------------------------# ##Install Meson & Ninja #Install diff --git a/scripts/runner/setup_x86_64-Linux.sh b/scripts/runner/setup_x86_64-Linux.sh index eb3f8eaf..67a105ba 100644 --- a/scripts/runner/setup_x86_64-Linux.sh +++ b/scripts/runner/setup_x86_64-Linux.sh @@ -300,30 +300,30 @@ if [ "${CONTINUE}" == "YES" ]; then sudo ldconfig && sudo ldconfig -p fi #----------------------# - ##Install Guix: https://guix.gnu.org/manual/en/html_node/Installation.html - curl -qfsSL "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh" -o "./guix-install.sh" - if [[ ! -s "./guix-install.sh" || $(stat -c%s "./guix-install.sh") -le 10 ]]; then - curl -qfsSL "https://raw.githubusercontent.com/Millak/guix/refs/heads/master/etc/guix-install.sh" -o "./guix-install.sh" - fi - chmod +x "./guix-install.sh" && yes '' | sudo "./guix-install.sh" --uninstall 2>/dev/null - yes '' | sudo "./guix-install.sh" - #Test - if ! command -v guix &> /dev/null; then - echo -e "\n[-] guix NOT Found\n" - export CONTINUE="NO" - return 1 || exit 1 - else - yes '' | guix install glibc-locales - export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale" - curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/nonguix.channels.scm" | sudo tee "/root/.config/guix/channels.scm" - GUIX_GIT_REPO="https://git.savannah.gnu.org/git/guix.git" - ##mirror - #GUIX_GIT_REPO="https://github.com/Millak/guix" - GUIX_LATEST_SHA="$(git ls-remote "${GUIX_GIT_REPO}" 'HEAD' | grep -w 'HEAD' | head -n 1 | awk '{print $1}' | tr -d '[:space:]')" - GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & - sudo GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & - wait ; guix --version - fi + ###Install Guix: https://guix.gnu.org/manual/en/html_node/Installation.html + #curl -qfsSL "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh" -o "./guix-install.sh" + #if [[ ! -s "./guix-install.sh" || $(stat -c%s "./guix-install.sh") -le 10 ]]; then + # curl -qfsSL "https://raw.githubusercontent.com/Millak/guix/refs/heads/master/etc/guix-install.sh" -o "./guix-install.sh" + #fi + #chmod +x "./guix-install.sh" && yes '' | sudo "./guix-install.sh" --uninstall 2>/dev/null + #yes '' | sudo "./guix-install.sh" + ##Test + #if ! command -v guix &> /dev/null; then + # echo -e "\n[-] guix NOT Found\n" + # export CONTINUE="NO" + # return 1 || exit 1 + #else + # yes '' | guix install glibc-locales + # export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale" + # curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/nonguix.channels.scm" | sudo tee "/root/.config/guix/channels.scm" + # GUIX_GIT_REPO="https://git.savannah.gnu.org/git/guix.git" + # ##mirror + # #GUIX_GIT_REPO="https://github.com/Millak/guix" + # GUIX_LATEST_SHA="$(git ls-remote "${GUIX_GIT_REPO}" 'HEAD' | grep -w 'HEAD' | head -n 1 | awk '{print $1}' | tr -d '[:space:]')" + # GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & + # sudo GIT_CONFIG_PARAMETERS="'filter.blob:none.enabled=true'" guix pull --url="${GUIX_GIT_REPO}" --commit="${GUIX_LATEST_SHA}" --cores="$(($(nproc)+1))" --max-jobs="2" --disable-authentication & + # wait ; guix --version + #fi #------------------------------# ##Install Meson & Ninja #Install