├── .circleci └── config.yml ├── .github ├── dependabot.yaml ├── shellcheck.txt └── workflows │ ├── auto_respond.yaml │ ├── build_aarch64_Linux.yaml │ ├── build_x86_64_Linux.yaml │ ├── check_links.yaml │ ├── kill_all_actions.yaml │ ├── matrix_builds.yaml │ ├── repo_linter.yaml │ ├── schedule_builds.yaml │ ├── sync_gh_releases.yaml │ └── sync_gh_releases_metadata.yaml ├── LICENSE ├── README.md ├── SBUILD_LIST.diff ├── SBUILD_LIST.diff.dupe ├── SBUILD_LIST.json ├── SBUILD_LIST.json.dupe ├── keys └── minisign.pub └── scripts ├── github ├── sync_releases.sh └── sync_releases_metadata.sh └── runner ├── builder.sh ├── functions.sh ├── setup_aarch64-Linux.sh ├── setup_env.sh ├── setup_riscv64-Linux.sh └── setup_x86_64-Linux.sh /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | #https://circleci.com/docs/introduction-to-yaml-configurations/ 2 | version: 2.1 3 | 4 | executors: 5 | linux-aarch64: 6 | machine: 7 | image: ubuntu-2404:current #https://circleci.com/developer/machine/image/ubuntu-2404 8 | resource_class: arm.large #4vCPU + 16GB RAM + 150GB DISK 9 | linux-x86_64: 10 | machine: 11 | image: ubuntu-2404:current #https://circleci.com/developer/machine/image/ubuntu-2404 12 | resource_class: large #4vCPU + 16GB RAM + 150GB DISK 13 | 14 | jobs: 15 | act-as-runner: 16 | parameters: 17 | os-type: 18 | type: string 19 | enum: ["linux-aarch64", "linux-x86_64"] 20 | runner: 21 | type: integer 22 | executor: << parameters.os-type >> 23 | 24 | steps: 25 | 26 | - run: 27 | name: Setup PreRequisites 28 | shell: /usr/bin/bash 29 | command: | 30 | ##presets 31 | #shellcheck disable=all 32 | set +x ; set +e ; set +o pipefail 33 | #-------------# 34 | ##ENV 35 | export DEBIAN_FRONTEND="noninteractive" 36 | echo "DEBIAN_FRONTEND=${DEBIAN_FRONTEND}" >> "${BASH_ENV}" 37 | ##UPDATE 38 | { 39 | sudo apt update -y -qq 40 | #https://github.com/ilikenwf/apt-fast?tab=readme-ov-file#quick-install 41 | bash -c "$(curl -qfsSL 'https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh')" 42 | if ! command -v apt-fast &>/dev/null; then 43 | echo -e "[-] Failed to find apt-fast\n" 44 | exit 1 45 | fi 46 | } || true 47 | 48 | - run: 49 | name: Install Deps 50 | shell: /usr/bin/bash 51 | when: on_success 52 | command: | 53 | ##presets 54 | #shellcheck disable=all 55 | set +x ; set +e ; set +o pipefail 56 | #-------------# 57 | { 58 | sudo apt-fast install bc coreutils curl dos2unix fdupes jq moreutils wget -y -qq 59 | sudo apt-fast install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null 60 | sudo apt-fast update -y -qq 2>/dev/null 61 | ##tmp 62 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 63 | ##GH ENV 64 | echo "SYSTMP=${SYSTMP}" >> "${BASH_ENV}" 65 | echo "GIT_TERMINAL_PROMPT=0" >> "${BASH_ENV}" 66 | echo "GIT_ASKPASS=/bin/echo" >> "${BASH_ENV}" 67 | SHELL="$(realpath $(which bash) | tr -d '[:space:]')" 68 | echo "SHELL=${SHELL}" >> "${BASH_ENV}" 69 | git config --global "credential.helper" store 70 | git config --global "user.email" "AjamX101@gmail.com" 71 | git config --global "user.name" "Azathothas" 72 | ##User-Agent 73 | #THIS CAUSES ESCAPING ISSUES 74 | #USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 75 | #echo "USER_AGENT=${USER_AGENT}" >> "${BASH_ENV}" 76 | ##Wget 77 | echo 'progress = dot:giga' | sudo tee -a "/etc/wgetrc" 78 | echo 'progress = dot:giga' | tee -a "${HOME}/.wgetrc" 79 | ##PrintENV 80 | echo -e "\n\n" && uname -a 81 | echo -e "\n\n" && realpath "$(which bash)" ; bash --version 82 | echo -e "\n\n" && env 83 | echo -e "\n\n" && df -h 84 | echo -e "\n\n" && echo 85 | } || true 86 | 87 | #- run: 88 | # name: Install Addons 89 | # shell: /usr/bin/bash 90 | # when: always 91 | # command: | 92 | # ##presets 93 | # #shellcheck disable=all 94 | # set +x ; set +e ; set +o pipefail 95 | # #-------------# 96 | # { 97 | # pushd "$(mktemp -d)" &>/dev/null 98 | # curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Linux/install_bins_curl.sh" -o "./install.sh" 99 | # sed -E 's/^[[:space:]]*##[Uu][Ss][Aa][Gg][Ee][[:space:]]*$/##Usage\n#shellcheck disable=all/' -i "./install.sh" 100 | # chmod '+xwr' -v "./install.sh" 101 | # dos2unix --quiet "./install.sh" 102 | # bash "./install.sh" 103 | # popd &>/dev/null 104 | # } || true 105 | 106 | - run: 107 | name: Fix Perms 108 | shell: /usr/bin/bash 109 | when: always 110 | command: | 111 | ##presets 112 | #shellcheck disable=all 113 | set +x ; set +e ; set +o pipefail 114 | #-------------# 115 | if [[ -d "/usr/local/go" ]]; then 116 | echo -e "\n[+] Existing Go Install Found, Removing...\n" 117 | sudo rm -rf "/usr/local/go" 118 | sudo rm -fv "$(realpath $(which go))" 2>/dev/null 119 | sudo rm -fv "$(which go)" 2>/dev/null 120 | #sudo chown -R "$(whoami):$(whoami)" "/usr/local/go" 121 | #sudo chmod -R 'u+rwX' "/usr/local/go" 122 | fi 123 | 124 | - run: 125 | name: Disable apparmor_restrict_unprivileged_userns 126 | shell: /usr/bin/bash 127 | when: always 128 | command: | 129 | ##presets 130 | #shellcheck disable=all 131 | set +x ; set +e ; set +o pipefail 132 | #-------------# 133 | { 134 | echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee "/etc/sysctl.d/98-apparmor-unuserns.conf" 135 | echo "0" | sudo tee "/proc/sys/kernel/apparmor_restrict_unprivileged_userns" 136 | sudo service procps restart 137 | sudo sysctl -p "/etc/sysctl.conf" 138 | } || true 139 | 140 | - run: 141 | name: Fetch Runner Tar 142 | shell: /usr/bin/bash 143 | when: always 144 | command: | 145 | ##presets 146 | #shellcheck disable=all 147 | set +x ; set +e ; set +o pipefail 148 | #-------------# 149 | pushd "$(mktemp -d)" &>/dev/null 150 | wget --quiet --show-progress "https://github.com/pkgforge/devscripts/releases/download/gh-$(uname -m)-$(uname -s)/runner.tar.gz" -O "./runner.tar.gz" 151 | if [ ! -f "./runner.tar.gz" ]; then 152 | exit 1 153 | fi 154 | sudo mkdir -p "/runner-init" 155 | sudo tar xzf "./runner.tar.gz" -C "/runner-init" 156 | rm -rvf "./runner.tar.gz" 157 | sudo chmod 'a+x' "/runner-init/bin/installdependencies.sh" 158 | sudo bash "/runner-init/bin/installdependencies.sh" 159 | sudo rm -rf "/var/lib/apt/lists/"* 2>/dev/null 160 | sudo curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/manage_linux.sh" -o "/usr/local/bin/manager.sh" 161 | if [ ! -f "/usr/local/bin/manager.sh" ]; then 162 | exit 1 163 | fi 164 | sudo chmod 'a+x' -v "/usr/local/bin/manager.sh" 165 | popd &>/dev/null 166 | 167 | - run: 168 | name: Run as External Runner 169 | no_output_timeout: 55m 170 | shell: /usr/bin/bash 171 | when: on_success 172 | environment: 173 | #GITHUB_PERSONAL_TOKEN: Set in Dashboard 174 | GITHUB_OWNER: "pkgforge" 175 | GITHUB_REPOSITORY: "pkgcache" 176 | command: | 177 | ##presets 178 | #shellcheck disable=all 179 | set +x ; set +e ; set +o pipefail 180 | #-------------# 181 | echo -e "\n\n" && env ; echo -e "\n\n" 182 | if [[ "$(uname -m | tr -d '[:space:]')" == "aarch64" ]]; then 183 | export RUNNER_NAME="circle-ci-arm64" 184 | export RUNNER_LABELS="aarch64-linux-circle,arm64-linux-circle" 185 | elif [[ "$(uname -m | tr -d '[:space:]')" == "x86_64" ]]; then 186 | export RUNNER_NAME="circle-ci-amd64" 187 | export RUNNER_LABELS="x64-linux-circle,amd64-linux-circle" 188 | fi 189 | ( "/usr/local/bin/manager.sh" & disown ) || true ; reset 190 | echo -e "\n[+] Waiting 10s..." && sleep 10 191 | echo -e "[+] Executing Runner..." 192 | while true; do 193 | if [[ -s '/tmp/GHA_CI_STATUS' && "$(cat '/tmp/GHA_CI_STATUS' | tr -d '[:space:]')" == "EXITED" ]]; then 194 | ( nohup pkill -INT -f "/usr/local/bin/manager.sh" &>/dev/null & disown ) &>/dev/null || true 195 | ( nohup pkill -TERM -f "/usr/local/bin/manager.sh" &>/dev/null & disown ) &>/dev/null || true 196 | echo -e "\n[+] Workflow Run Concluded\n" 197 | exit 0 198 | fi 199 | sleep 7 200 | done 201 | 202 | workflows: 203 | run-external-runners: 204 | jobs: 205 | - act-as-runner: 206 | matrix: 207 | parameters: 208 | os-type: ["linux-aarch64", "linux-x86_64"] 209 | runner: [1] #--> 2 Total Runners 210 | #runner: [1, 2] #--> 4 Total Runners 211 | #runner: [1, 2, 3, 4, 5, 6] #--> 12 Total Runners -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | #Bare bones dependabot only for GH Workflow Files 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" -------------------------------------------------------------------------------- /.github/shellcheck.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkgforge/pkgcache/fd85daff9fc3670ce4419daea4a526becb8404b3/.github/shellcheck.txt -------------------------------------------------------------------------------- /.github/workflows/auto_respond.yaml: -------------------------------------------------------------------------------- 1 | name: 🤖 Auto Respond [Discussions|Issues|PRs] ℹ️ 2 | env: 3 | GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}" 4 | on: 5 | issues: 6 | types: [opened] 7 | pull_request: 8 | types: [opened] 9 | discussion: 10 | types: [created] 11 | workflow_dispatch: #will fail 12 | jobs: 13 | auto-respond: 14 | runs-on: ubuntu-latest 15 | #permissions: 16 | # issues: write 17 | # pull-requests: write 18 | # discussions: write 19 | steps: 20 | 21 | - name: Get GitHub context 22 | env: 23 | EVENT_JSON: ${{ toJson(github.event) }} 24 | run: | 25 | #Presets 26 | set +x ; set +e 27 | #--------------# 28 | printf '%s\n' "$EVENT_JSON" | jq . 29 | continue-on-error: true 30 | 31 | - name: Set GitHub ENV 32 | run: | 33 | #Presets 34 | set +x ; set +e 35 | #--------------# 36 | echo "Repository: ${{ github.repository }}" 37 | echo "Branch: ${{ github.ref }}" 38 | echo "Actor: ${{ github.actor }}" 39 | echo "Event: ${{ github.event_name }}" 40 | if [[ "${{ github.event_name }}" == "discussion" ]]; then 41 | #DISCUSSION_ID="${{ github.event.discussion.id }}" 42 | DISCUSSION_ID="${{ github.event.discussion.node_id }}" 43 | echo "DISCUSSION_ID=${DISCUSSION_ID}" >> "${GITHUB_ENV}" 44 | echo "New Discussion! [Discussion ID: ${DISCUSSION_ID}]" 45 | echo -e "🤖 **Automated Response** \nThanks for starting this discussion! \n**Quick Details:** \n- 💬 We're excited to hear your thoughts \n- 🕒 Typical response time is 12-24 hours \n*Want to connect more with our team and community?* \n**Join Our Discord:** https://discord.gg/djJUs48Zbu \nDive deeper with us and get involved!" > "/tmp/DISCUSSION.md" 46 | #DISCUSSION_MESSAGE="$(cat '/tmp/DISCUSSION.md')" ; export DISCUSSION_MESSAGE 47 | echo "MESSAGE=/tmp/DISCUSSION.md" >> "${GITHUB_ENV}" 48 | elif [[ "${{ github.event_name }}" == "issues" ]]; then 49 | COMMENT_URL="$(echo ${{ github.event.issue.comments_url }} | tr -d '[:space:]')" 50 | echo "COMMENT_URL=${COMMENT_URL}" >> "${GITHUB_ENV}" 51 | echo "New Issue! [Comments URL: ${COMMENT_URL}]" 52 | echo -e "🤖 **Automated Response** \nThanks for opening this issue! \n**Quick Details:** \n- 📋 We'll review it shortly \n- 🕒 Typical response time is 12-24 hours \n*Want faster resolution or more community support?* \n**Join Our Discord:** https://discord.gg/djJUs48Zbu \nConnect directly with our team, get quicker responses, and engage with our community!" > "/tmp/ISSUE.md" 53 | #ISSUE_MESSAGE="$(cat '/tmp/ISSUE.md')" ; export ISSUE_MESSAGE 54 | echo "MESSAGE=/tmp/ISSUE.md" >> "${GITHUB_ENV}" 55 | elif [[ "${{ github.event_name }}" == "pull_request" ]]; then 56 | COMMENT_URL="$(echo ${{ github.event.pull_request.comments_url }} | tr -d '[:space:]')" 57 | echo "COMMENT_URL=${COMMENT_URL}" >> "${GITHUB_ENV}" 58 | echo "New Pull Request! [Comments URL: ${COMMENT_URL}]" 59 | echo -e "🤖 **Automated Response** \nThanks for opening this pull request! \n**Quick Details:** \n- 📋 We'll review it shortly \n- 🕒 Typical response time is 12-24 hours \n*Want faster resolution or more community support?* \n**Join Our Discord:** https://discord.gg/djJUs48Zbu \nConnect directly with our team, get quicker responses, and engage with our community!" > "/tmp/PR.md" 60 | #PR_MESSAGE="$(cat '/tmp/PR.md')" ; export PR_MESSAGE 61 | echo "MESSAGE=/tmp/PR.md" >> "${GITHUB_ENV}" 62 | else 63 | echo "Unsupported event: ${{ github.event_name }}" 64 | fi 65 | continue-on-error: true 66 | 67 | - name: Reply (Discussion) 68 | run: | 69 | #Presets 70 | set +x ; set +e 71 | #--------------# 72 | set -x 73 | if [ -n "${DISCUSSION_ID}" ]; then 74 | #https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions 75 | COMMENT_BODY="$(cat ${MESSAGE})" 76 | QUERY=$(jq -n --arg discussionId "${DISCUSSION_ID}" --arg body "${COMMENT_BODY}" '{"query":"mutation AddDiscussionComment($discussionId: ID!, $body: String!) { addDiscussionComment(input: {discussionId: $discussionId, body: $body}) { comment { id body } } }","variables":{"discussionId":$discussionId,"body":$body}}') 77 | curl -qfsSL -X 'POST' "https://api.github.com/graphql" -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 78 | -d "$QUERY" 79 | fi 80 | continue-on-error: true 81 | 82 | - name: Reply (Issues|PRs) 83 | run: | 84 | #Presets 85 | set +x ; set +e 86 | #--------------# 87 | if [ -n "${COMMENT_URL}" ]; then 88 | curl -qfsSL -X 'POST' "${COMMENT_URL}" -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 89 | -d "{\"body\": $(cat "${MESSAGE}" | jq -Rs .)}" 90 | fi 91 | continue-on-error: true 92 | -------------------------------------------------------------------------------- /.github/workflows/build_aarch64_Linux.yaml: -------------------------------------------------------------------------------- 1 | name: 🛍️ Build 📀 (Pkgcache-aarch64-Linux) Packages 📦📀 2 | concurrency: 3 | group: "${{ github.workflow }}-${{ github.ref }}" 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: "30 18 * * Mon,Wed,Sat" # 06:30 PM UTC (12:15 AM NPT Mrng) 10 | #- cron: "30 18 * * 1,3,6" # 06:30 PM UTC (12:15 AM NPT Mrng) 11 | env: 12 | EXCLUDE_CACHED: "YES" #No--> Manually checks if should build one by one (If rebuild == true, it's added regardless) 13 | FORCE_REBUILD_ALL: "NO" #YES--> Force Rebuild everything, will take several tries & fail several times 14 | KEEP_LOGS: "NO" #YES--> Keeps Dirs & Files 15 | NOTIFY_DISCORD: "NO" #NO--> Don't send Notifications to Discord 16 | jobs: 17 | #------------------------------------------------------------------------------------# 18 | presetup: 19 | runs-on: ubuntu-latest 20 | timeout-minutes: 30 21 | permissions: 22 | contents: write 23 | 24 | steps: 25 | - name: Checkout repository 26 | uses: actions/checkout@v4 27 | with: 28 | path: main 29 | filter: "blob:none" 30 | #------------------------------------------------------------------------------------# 31 | - name: Install Addons 32 | run: | 33 | #presets 34 | set -x ; set +e 35 | #-------------# 36 | #bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 37 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/rclone" -o "/usr/local/bin/rclone" && sudo chmod +x "/usr/local/bin/rclone" 38 | continue-on-error: true 39 | #------------------------------------------------------------------------------------# 40 | - name: Setup Env 41 | run: | 42 | ##presets 43 | set +x ; set +e 44 | #-------------# 45 | ##CoreUtils 46 | sudo apt update -y 47 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 48 | sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null 49 | ##tmp 50 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 51 | #GH ENV 52 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 53 | #GH Dirs 54 | mkdir -p "${GITHUB_WORKSPACE}/main/aarch64-Linux" 55 | #-------------# 56 | mkdir -p "${HOME}/bin" 57 | sudo apt update -y 58 | sudo apt install dos2unix -y 59 | ##User-Agent 60 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 61 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 62 | continue-on-error: true 63 | 64 | - name: Sanity Check 65 | run: | 66 | # Presets 67 | set +x ; set +e 68 | #--------------# 69 | pushd "$(mktemp -d)" >/dev/null 2>&1 70 | 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:]')" 71 | if [[ "${PKG_COUNT}" -le 10 ]]; then 72 | echo -e "\n[+] FATAL: Too few Packages to Build\n" 73 | exit 1 74 | fi 75 | popd >/dev/null 2>&1 76 | continue-on-error: false 77 | 78 | - name: Set TZ to (Asia/Kathmandu) 79 | run: | 80 | # Presets 81 | set +x ; set +e 82 | #--------------# 83 | sudo apt-get update -y && sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata 84 | sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime" 85 | sudo dpkg-reconfigure --frontend noninteractive tzdata 86 | sudo apt-get install apt-utils software-properties-common -y 87 | sudo apt-get update -y 88 | continue-on-error: true 89 | #------------------------------------------------------------------------------------# 90 | #------------------------------------------------------------------------------------# 91 | build-fetch-packages: 92 | #runs-on: ubuntu-latest 93 | runs-on: arm64-linux-pkgcache 94 | needs: [presetup] 95 | timeout-minutes: 3200 96 | permissions: 97 | attestations: write 98 | contents: write 99 | id-token: write 100 | packages: write 101 | 102 | steps: 103 | - name: Checkout repository 104 | uses: actions/checkout@v4 105 | with: 106 | path: main 107 | filter: "blob:none" 108 | 109 | #- name: Install Addons 110 | # run: | 111 | # #presets 112 | # set -x ; set +e 113 | # #-------------# 114 | # bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 115 | # continue-on-error: true 116 | #------------------------------------------------------------------------------------# 117 | - name: Setup Env 118 | run: | 119 | ##presets 120 | set +x ; set +e 121 | #-------------# 122 | ##CoreUtils 123 | sudo apt update -y 124 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 125 | sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null 126 | ##tmp 127 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 128 | #GH ENV 129 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 130 | #GH Dirs 131 | mkdir -p "${GITHUB_WORKSPACE}/main/aarch64-Linux" 132 | #-------------# 133 | mkdir -p "${HOME}/bin" 134 | sudo apt update -y 135 | sudo apt install dos2unix -y 136 | ##Setup Minisign 137 | mkdir -pv "${HOME}/.minisign" 138 | echo "${{ secrets.MINISIGN_SIGKEY }}" > "${HOME}/.minisign/pkgforge.key" 139 | ##User-Agent 140 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 141 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 142 | continue-on-error: true 143 | 144 | #- name: Cache Container Images 145 | # run: | 146 | # ##presets 147 | # set +x ; set +e 148 | # #-------------# 149 | # 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 150 | # continue-on-error: true 151 | 152 | - name: Notify (Discord) [Trigger] 153 | if: env.NOTIFY_DISCORD != 'NO' 154 | run: | 155 | ##presets 156 | set +x ; set +e 157 | #-------------# 158 | pushd "$(mktemp -d)" >/dev/null 2>&1 159 | #Setup Config 160 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" 161 | echo 'discord:' > "./notify.yaml" 162 | echo ' - id: "portable-apps"' >> "./notify.yaml" 163 | echo ' discord_channel: "main"' >> "./notify.yaml" 164 | echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" 165 | echo ' discord_format: "{{data}}"' >> "./notify.yaml" 166 | echo " discord_webhook_url: \"${{ secrets.DISCORD_NOTIFY }}\"" >> "./notify.yaml" 167 | #Prep Body 168 | GH_EVENT="${{ github.event_name }}" 169 | GH_WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" 170 | START_TIME="$(date +%s)" && export START_TIME 171 | echo "GH_EVENT=${GH_EVENT}" >> "${GITHUB_ENV}" 172 | echo "GH_WORKFLOW_URL=${GH_WORKFLOW_URL}" >> "${GITHUB_ENV}" 173 | echo "START_TIME=${START_TIME}" >> "${GITHUB_ENV}" 174 | 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:]')" 175 | echo "GH_RECIPE_COUNT=${GH_RECIPE_COUNT}" >> "${GITHUB_ENV}" 176 | 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:]')" 177 | echo "GH_DISABLED_COUNT=${GH_DISABLED_COUNT}" >> "${GITHUB_ENV}" 178 | 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:]')" 179 | echo "GH_REBUILD_COUNT=${GH_REBUILD_COUNT}" >> "${GITHUB_ENV}" 180 | rm -rvf "/tmp/PKGFORGE_DISCORD.md" 2>/dev/null 181 | 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" 182 | echo '**`Host`**: `aarch64-Linux`' >> "/tmp/PKGFORGE_DISCORD.md" 183 | echo '**`Event`**: `'"${GH_EVENT}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 184 | #echo '**`Workflow`**: "'${GH_WORKFLOW_URL}'"' >> "/tmp/PKGFORGE_DISCORD.md" 185 | echo '**`Workflow`**: '${GH_WORKFLOW_URL}' ' >> "/tmp/PKGFORGE_DISCORD.md" 186 | echo '**`Maintainer`**: @Azathothas' >> "/tmp/PKGFORGE_DISCORD.md" 187 | echo '**`Packages (pkg_family)`**: `'"Total: ${GH_RECIPE_COUNT} (Disabled: ${GH_DISABLED_COUNT}) (Rebuilt: ${GH_REBUILD_COUNT})"'`' >> "/tmp/PKGFORGE_DISCORD.md" 188 | echo '**`Preserving TMPFILES?`**: `'"${KEEP_LOGS}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 189 | echo '**`Rebuilding?`**: `'"${FORCE_REBUILD_ALL}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 190 | cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check 191 | echo -e "\n\n" && cat "/tmp/PKGFORGE_DISCORD.md" && echo -e "\n\n" 192 | popd >/dev/null 2>&1 193 | continue-on-error: true 194 | 195 | #- name: Set TZ to (Asia/Kathmandu) 196 | # run: | 197 | # # Presets 198 | # set +x ; set +e 199 | # #--------------# 200 | # sudo apt-get update -y && sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata 201 | # sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime" 202 | # sudo dpkg-reconfigure --frontend noninteractive tzdata 203 | # sudo apt-get install apt-utils software-properties-common -y 204 | # sudo apt-get update -y 205 | # continue-on-error: true 206 | #------------------------------------------------------------------------------------# 207 | #Main Build Script 208 | - name: BUILD 209 | env: 210 | #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" #Needs Actions' Token if we want to make the packages public 211 | GHCR_TOKEN: "${{ github.token }}" 212 | GITHUB_TOKEN: "${{ secrets.RO_GHTOKEN }}" 213 | GITLAB_TOKEN: "${{ secrets.RO_GLTOKEN }}" 214 | MINISIGN_KEY: "${{ secrets.MINISIGN_KEY }}" 215 | run: | 216 | #Presets 217 | set +x ; set +e 218 | #--------------# 219 | ##Main 220 | pushd "$(mktemp -d)" >/dev/null 2>&1 221 | curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/runner/builder.sh" -o "${SYSTMP}/BUILDER.sh" 222 | dos2unix --quiet "${SYSTMP}/BUILDER.sh" ; chmod +xwr "${SYSTMP}/BUILDER.sh" 223 | ##Run with STDOUT [Slow, Not Recommended] 224 | #bash "${SYSTMP}/BUILDER.sh" 225 | ##Run with LOGS only 226 | #bash "${SYSTMP}/BUILDER.sh" > "${SYSTMP}/BUILD.log" 2>&1 227 | ##Run with STDOUT + LOGS 228 | bash "${SYSTMP}/BUILDER.sh" | tee "${SYSTMP}/BUILD.log" 2>&1 229 | ##Run without STDOUT/Logs 230 | #bash "${SYSTMP}/BUILDER.sh" >/dev/null 2>&1 231 | if [[ -f "${SYSTMP}/BUILD.log" ]] && [[ $(stat -c%s "${SYSTMP}/BUILD.log") -gt 1024 ]]; then 232 | ##Purge Tokens (in case set -x & gh didn't redact) 233 | cat "${SYSTMP}/BUILD.log" | ansi2txt > "${SYSTMP}/BUILD.gh.log.txt" 234 | sed -i '/.*github_pat.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 235 | sed -i '/.*ghp_.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 236 | sed -i '/.*access_key_id.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 237 | sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 238 | sed -i '/.*secret_access_key.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 239 | sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 240 | sed -i '/.*cloudflarestorage.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 241 | ##Fetch Only Relevant Logs 242 | if grep -iq "completed" "${SYSTMP}/BUILD.gh.log.txt"; then 243 | mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD.log" 244 | elif grep -iq "initializing" "${SYSTMP}/BUILD.gh.log.txt"; then 245 | mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD_FAILED.log" 246 | BUILD_FAILED="YES" 247 | echo "BUILD_FAILED=${BUILD_FAILED}" >> "${GITHUB_ENV}" 248 | fi 249 | ##rClone Upload logs 250 | 7z a -t7z -mx=9 -mmt="$(($(nproc)+1))" -bsp1 -bt "./${{ github.run_id }}.log.xz" "${SYSTMP}/BUILD.log" 2>/dev/null 251 | #rclone copyto "./${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/${{ github.run_id }}.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" & 252 | if [[ -s "${SYSTMP}/BUILD_FAILED.log" && $(stat -c%s "${SYSTMP}/BUILD_FAILED.log") -gt 10 ]]; then 253 | 7z a -t7z -mx=9 -mmt="$(($(nproc)+1))" -bsp1 -bt "./${{ github.run_id }}.log.xz" "${SYSTMP}/BUILD_FAILED.log" 2>/dev/null 254 | #rclone copyto "./${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/${{ github.run_id }}.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" 255 | fi 256 | wait ; echo 257 | fi 258 | popd >/dev/null 2>&1 259 | continue-on-error: true 260 | #------------------------------------------------------------------------------------# 261 | ##Logs & Artifacts 262 | - name: Get DateTime 263 | run: | 264 | #Presets 265 | set +x ; set +e 266 | #--------------# 267 | UTC_TIME="$(TZ='UTC' date +'%Y_%m_%dT%I_%M_%S_%p')" 268 | echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}" 269 | continue-on-error: true 270 | 271 | - name: Upload (aarch64-Linux) Artifacts 272 | uses: actions/upload-artifact@v4 273 | with: 274 | name: Pkgcache_aarch64-Linux 275 | path: | 276 | /tmp/BUILD.log 277 | compression-level: 0 # no compression, [Default: 6 (GNU Gzip)] 278 | retention-days: 30 279 | overwrite: true 280 | continue-on-error: true 281 | 282 | - name: Attest Build Provenance 283 | uses: actions/attest-build-provenance@v2.3.0 284 | with: 285 | subject-name: "build-logs-aarch64-Linux-${{ env.UTC_TIME }}" 286 | subject-path: "/tmp/BUILD.log" 287 | show-summary: true 288 | continue-on-error: true 289 | #------------------------------------------------------------------------------------# 290 | - name: Notify Discord [Completion] 291 | if: env.NOTIFY_DISCORD != 'NO' 292 | run: | 293 | ##presets 294 | set +x ; set +e 295 | #-------------# 296 | pushd "$(mktemp -d)" >/dev/null 2>&1 297 | #Setup Config 298 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" 299 | echo 'discord:' > "./notify.yaml" 300 | echo ' - id: "portable-apps"' >> "./notify.yaml" 301 | echo ' discord_channel: "main"' >> "./notify.yaml" 302 | echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" 303 | echo ' discord_format: "{{data}}"' >> "./notify.yaml" 304 | echo " discord_webhook_url: \"${{ secrets.DISCORD_NOTIFY }}\"" >> "./notify.yaml" 305 | #Prep Body 306 | ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" 307 | END_TIME="$(date +%s)" && export END_TIME="${END_TIME}" 308 | SECS="$((END_TIME - START_TIME))" 309 | #ELAPSED_TIME="$(date -u -d@"$((END_TIME - START_TIME))" "+%H(Hr):%M(Min):%S(Sec)")" 310 | ELAPSED_TIME="$((SECS/86400))(Day):$(date -u -d@$((SECS%86400)) '+%H(Hr):%M(Min):%S(Sec)')" 311 | echo "ELAPSED_TIME=${ELAPSED_TIME}" >> "${GITHUB_ENV}" 312 | rm -rvf "/tmp/PKGFORGE_DISCORD.md" 2>/dev/null 313 | 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" 314 | echo '**`Host`**: `aarch64-Linux`' >> "/tmp/PKGFORGE_DISCORD.md" 315 | echo '**`Event`**: `'"${GH_EVENT}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 316 | echo '**`Logs (VERBOSE)`**: https://bin.pkgforge.dev/aarch64-Linux/BUILD.log.txt' >> "/tmp/PKGFORGE_DISCORD.md" 317 | if [[ "${BUILD_FAILED}" == "YES" ]]; then 318 | echo '**`Logs (FAILED)`**: https://bin.pkgforge.dev/aarch64-Linux/BUILD_FAILED.log.txt' >> "/tmp/PKGFORGE_DISCORD.md" 319 | fi 320 | #echo '**`Workflow`**: "'${GH_WORKFLOW_URL}'"' >> "/tmp/PKGFORGE_DISCORD.md" 321 | echo '**`Workflow`**: '${GH_WORKFLOW_URL}' ' >> "/tmp/PKGFORGE_DISCORD.md" 322 | echo '**`Maintainer`**: @Azathothas' >> "/tmp/PKGFORGE_DISCORD.md" 323 | echo '**`Packages (pkg_family)`**: `'"Total: ${GH_RECIPE_COUNT} (Disabled: ${GH_DISABLED_COUNT}) (Rebuilt: ${GH_REBUILD_COUNT})"'`' >> "/tmp/PKGFORGE_DISCORD.md" 324 | echo '**`Packages (Make these PUBLIC)`**: https://github.com/orgs/pkgforge/packages?visibility=private' >> "/tmp/PKGFORGE_DISCORD.md" 325 | echo '**`Preserved TMPFILES?`**: `'"${KEEP_LOGS}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 326 | echo '**`Rebuilt?`**: `'"${FORCE_REBUILD_ALL}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 327 | echo '**`Total Time`**: `'"${ELAPSED_TIME}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 328 | cat "${SYSTMP}/BUILD.log" | grep -i 'FATAL' | sed -E 's/.*Could NOT Build ([a-z0-9]*\.static).*?(https.*\.yaml\])/\1 [\2/' > "./FAILED.txt" 329 | if [[ -s "./FAILED.txt" && $(stat -c%s "./FAILED.txt") -gt 10 ]]; then 330 | echo '**`Failed Builds`**: ==>' >> "/tmp/PKGFORGE_DISCORD.md" 331 | cat "./FAILED.txt" >> "/tmp/PKGFORGE_DISCORD.md" 332 | fi 333 | cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check 334 | echo -e "\n\n" && cat "/tmp/PKGFORGE_DISCORD.md" && echo -e "\n\n" 335 | popd >/dev/null 2>&1 336 | continue-on-error: true 337 | #------------------------------------------------------------------------------------# -------------------------------------------------------------------------------- /.github/workflows/build_x86_64_Linux.yaml: -------------------------------------------------------------------------------- 1 | name: 🛍️ Build 📀 (Pkgcache-x86_64-Linux) Packages 📦📀 2 | concurrency: 3 | group: "${{ github.workflow }}-${{ github.ref }}" 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: "30 18 * * Mon,Wed,Sat" # 06:30 PM UTC (12:15 AM NPT Mrng) 10 | #- cron: "30 18 * * 1,3,6" # 06:30 PM UTC (12:15 AM NPT Mrng) 11 | env: 12 | EXCLUDE_CACHED: "YES" #No--> Manually checks if should build one by one (If rebuild == true, it's added regardless) 13 | FORCE_REBUILD_ALL: "NO" #YES--> Force Rebuild everything, will take several tries & fail several times 14 | KEEP_LOGS: "NO" #YES--> Keeps Dirs & Files 15 | NOTIFY_DISCORD: "NO" #NO--> Don't send Notifications to Discord 16 | jobs: 17 | #------------------------------------------------------------------------------------# 18 | presetup: 19 | runs-on: ubuntu-latest 20 | timeout-minutes: 30 21 | permissions: 22 | contents: write 23 | 24 | steps: 25 | - name: Checkout repository 26 | uses: actions/checkout@v4 27 | with: 28 | path: main 29 | filter: "blob:none" 30 | #------------------------------------------------------------------------------------# 31 | - name: Install Addons 32 | run: | 33 | #presets 34 | set -x ; set +e 35 | #-------------# 36 | #bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 37 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/rclone" -o "/usr/local/bin/rclone" && sudo chmod +x "/usr/local/bin/rclone" 38 | continue-on-error: true 39 | #------------------------------------------------------------------------------------# 40 | - name: Setup Env 41 | run: | 42 | ##presets 43 | set +x ; set +e 44 | #-------------# 45 | ##CoreUtils 46 | sudo apt update -y 47 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 48 | sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null 49 | ##tmp 50 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 51 | #GH ENV 52 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 53 | #GH Dirs 54 | mkdir -p "${GITHUB_WORKSPACE}/main/x86_64-Linux" 55 | #-------------# 56 | mkdir -p "${HOME}/bin" 57 | sudo apt update -y 58 | sudo apt install dos2unix -y 59 | ##User-Agent 60 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 61 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 62 | continue-on-error: true 63 | 64 | - name: Sanity Check 65 | run: | 66 | # Presets 67 | set +x ; set +e 68 | #--------------# 69 | pushd "$(mktemp -d)" >/dev/null 2>&1 70 | 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:]')" 71 | if [[ "${PKG_COUNT}" -le 10 ]]; then 72 | echo -e "\n[+] FATAL: Too few Packages to Build\n" 73 | exit 1 74 | fi 75 | popd >/dev/null 2>&1 76 | continue-on-error: false 77 | 78 | - name: Set TZ to (Asia/Kathmandu) 79 | run: | 80 | # Presets 81 | set +x ; set +e 82 | #--------------# 83 | sudo apt-get update -y && sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata 84 | sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime" 85 | sudo dpkg-reconfigure --frontend noninteractive tzdata 86 | sudo apt-get install apt-utils software-properties-common -y 87 | sudo apt-get update -y 88 | continue-on-error: true 89 | #------------------------------------------------------------------------------------# 90 | #------------------------------------------------------------------------------------# 91 | build-fetch-packages: 92 | #runs-on: ubuntu-latest 93 | runs-on: amd64-linux-pkgcache 94 | needs: [presetup] 95 | timeout-minutes: 3200 96 | permissions: 97 | attestations: write 98 | contents: write 99 | id-token: write 100 | packages: write 101 | 102 | steps: 103 | - name: Checkout repository 104 | uses: actions/checkout@v4 105 | with: 106 | path: main 107 | filter: "blob:none" 108 | 109 | #- name: Install Addons 110 | # run: | 111 | # #presets 112 | # set -x ; set +e 113 | # #-------------# 114 | # bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 115 | # continue-on-error: true 116 | #------------------------------------------------------------------------------------# 117 | - name: Setup Env 118 | run: | 119 | ##presets 120 | set +x ; set +e 121 | #-------------# 122 | ##CoreUtils 123 | sudo apt update -y 124 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 125 | sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null 126 | ##tmp 127 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 128 | #GH ENV 129 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 130 | #GH Dirs 131 | mkdir -p "${GITHUB_WORKSPACE}/main/x86_64-Linux" 132 | #-------------# 133 | mkdir -p "${HOME}/bin" 134 | sudo apt update -y 135 | sudo apt install dos2unix -y 136 | ##Setup Minisign 137 | mkdir -pv "${HOME}/.minisign" 138 | echo "${{ secrets.MINISIGN_SIGKEY }}" > "${HOME}/.minisign/pkgforge.key" 139 | ##User-Agent 140 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 141 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 142 | continue-on-error: true 143 | 144 | #- name: Cache Container Images 145 | # run: | 146 | # ##presets 147 | # set +x ; set +e 148 | # #-------------# 149 | # 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 150 | # continue-on-error: true 151 | 152 | - name: Notify (Discord) [Trigger] 153 | if: env.NOTIFY_DISCORD != 'NO' 154 | run: | 155 | ##presets 156 | set +x ; set +e 157 | #-------------# 158 | pushd "$(mktemp -d)" >/dev/null 2>&1 159 | #Setup Config 160 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" 161 | echo 'discord:' > "./notify.yaml" 162 | echo ' - id: "portable-apps"' >> "./notify.yaml" 163 | echo ' discord_channel: "main"' >> "./notify.yaml" 164 | echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" 165 | echo ' discord_format: "{{data}}"' >> "./notify.yaml" 166 | echo " discord_webhook_url: \"${{ secrets.DISCORD_NOTIFY }}\"" >> "./notify.yaml" 167 | #Prep Body 168 | GH_EVENT="${{ github.event_name }}" 169 | GH_WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" 170 | START_TIME="$(date +%s)" && export START_TIME 171 | echo "GH_EVENT=${GH_EVENT}" >> "${GITHUB_ENV}" 172 | echo "GH_WORKFLOW_URL=${GH_WORKFLOW_URL}" >> "${GITHUB_ENV}" 173 | echo "START_TIME=${START_TIME}" >> "${GITHUB_ENV}" 174 | 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:]')" 175 | echo "GH_RECIPE_COUNT=${GH_RECIPE_COUNT}" >> "${GITHUB_ENV}" 176 | 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:]')" 177 | echo "GH_DISABLED_COUNT=${GH_DISABLED_COUNT}" >> "${GITHUB_ENV}" 178 | 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:]')" 179 | echo "GH_REBUILD_COUNT=${GH_REBUILD_COUNT}" >> "${GITHUB_ENV}" 180 | rm -rvf "/tmp/PKGFORGE_DISCORD.md" 2>/dev/null 181 | echo 'ℹ️ **Triggered** [🛍️ Build 📦 Pkgcache] (Weekly) ==> https://github.com/pkgforge/pkgcache/blob/main/.github/workflows/build_x86_64_Linux.yaml `['"$(date --utc +'%Y-%m-%dT%H:%M:%S.%3N')"' UTC]`' > "/tmp/PKGFORGE_DISCORD.md" 182 | echo '**`Host`**: `x86_64-Linux`' >> "/tmp/PKGFORGE_DISCORD.md" 183 | echo '**`Event`**: `'"${GH_EVENT}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 184 | #echo '**`Workflow`**: "'${GH_WORKFLOW_URL}'"' >> "/tmp/PKGFORGE_DISCORD.md" 185 | echo '**`Workflow`**: '${GH_WORKFLOW_URL}' ' >> "/tmp/PKGFORGE_DISCORD.md" 186 | echo '**`Maintainer`**: @Azathothas' >> "/tmp/PKGFORGE_DISCORD.md" 187 | echo '**`Packages (pkg_family)`**: `'"Total: ${GH_RECIPE_COUNT} (Disabled: ${GH_DISABLED_COUNT}) (Rebuilt: ${GH_REBUILD_COUNT})"'`' >> "/tmp/PKGFORGE_DISCORD.md" 188 | echo '**`Preserving TMPFILES?`**: `'"${KEEP_LOGS}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 189 | echo '**`Rebuilding?`**: `'"${FORCE_REBUILD_ALL}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 190 | cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check 191 | echo -e "\n\n" && cat "/tmp/PKGFORGE_DISCORD.md" && echo -e "\n\n" 192 | popd >/dev/null 2>&1 193 | continue-on-error: true 194 | 195 | #- name: Set TZ to (Asia/Kathmandu) 196 | # run: | 197 | # # Presets 198 | # set +x ; set +e 199 | # #--------------# 200 | # sudo apt-get update -y && sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata 201 | # sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime" 202 | # sudo dpkg-reconfigure --frontend noninteractive tzdata 203 | # sudo apt-get install apt-utils software-properties-common -y 204 | # sudo apt-get update -y 205 | # continue-on-error: true 206 | #------------------------------------------------------------------------------------# 207 | #Main Build Script 208 | - name: BUILD 209 | env: 210 | #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" #Needs Actions' Token if we want to make the packages public 211 | GHCR_TOKEN: "${{ github.token }}" 212 | GITHUB_TOKEN: "${{ secrets.RO_GHTOKEN }}" 213 | GITLAB_TOKEN: "${{ secrets.RO_GLTOKEN }}" 214 | MINISIGN_KEY: "${{ secrets.MINISIGN_KEY }}" 215 | run: | 216 | #Presets 217 | set +x ; set +e 218 | #--------------# 219 | ##Main 220 | pushd "$(mktemp -d)" >/dev/null 2>&1 221 | curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/runner/builder.sh" -o "${SYSTMP}/BUILDER.sh" 222 | dos2unix --quiet "${SYSTMP}/BUILDER.sh" ; chmod +xwr "${SYSTMP}/BUILDER.sh" 223 | ##Run with STDOUT [Slow, Not Recommended] 224 | #bash "${SYSTMP}/BUILDER.sh" 225 | ##Run with LOGS only 226 | #bash "${SYSTMP}/BUILDER.sh" > "${SYSTMP}/BUILD.log" 2>&1 227 | ##Run with STDOUT + LOGS 228 | bash "${SYSTMP}/BUILDER.sh" | tee "${SYSTMP}/BUILD.log" 2>&1 229 | ##Run without STDOUT/Logs 230 | #bash "${SYSTMP}/BUILDER.sh" >/dev/null 2>&1 231 | if [[ -f "${SYSTMP}/BUILD.log" ]] && [[ $(stat -c%s "${SYSTMP}/BUILD.log") -gt 1024 ]]; then 232 | ##Purge Tokens (in case set -x & gh didn't redact) 233 | cat "${SYSTMP}/BUILD.log" | ansi2txt > "${SYSTMP}/BUILD.gh.log.txt" 234 | sed -i '/.*github_pat.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 235 | sed -i '/.*ghp_.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 236 | sed -i '/.*access_key_id.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 237 | sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 238 | sed -i '/.*secret_access_key.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 239 | sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 240 | sed -i '/.*cloudflarestorage.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 241 | ##Fetch Only Relevant Logs 242 | if grep -iq "completed" "${SYSTMP}/BUILD.gh.log.txt"; then 243 | mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD.log" 244 | elif grep -iq "initializing" "${SYSTMP}/BUILD.gh.log.txt"; then 245 | mv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD_FAILED.log" 246 | BUILD_FAILED="YES" 247 | echo "BUILD_FAILED=${BUILD_FAILED}" >> "${GITHUB_ENV}" 248 | fi 249 | ##rClone Upload logs 250 | 7z a -t7z -mx=9 -mmt="$(($(nproc)+1))" -bsp1 -bt "./${{ github.run_id }}.log.xz" "${SYSTMP}/BUILD.log" 2>/dev/null 251 | #rclone copyto "./${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/${{ github.run_id }}.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" & 252 | if [[ -s "${SYSTMP}/BUILD_FAILED.log" && $(stat -c%s "${SYSTMP}/BUILD_FAILED.log") -gt 10 ]]; then 253 | 7z a -t7z -mx=9 -mmt="$(($(nproc)+1))" -bsp1 -bt "./${{ github.run_id }}.log.xz" "${SYSTMP}/BUILD_FAILED.log" 2>/dev/null 254 | #rclone copyto "./${{ github.run_id }}.log.xz" "r2:/meta/pkgcache/logs/${{ github.run_id }}.log.xz" --checksum --check-first --user-agent="${USER_AGENT}" 255 | fi 256 | wait ; echo 257 | fi 258 | popd >/dev/null 2>&1 259 | continue-on-error: true 260 | #------------------------------------------------------------------------------------# 261 | ##Logs & Artifacts 262 | - name: Get DateTime 263 | run: | 264 | #Presets 265 | set +x ; set +e 266 | #--------------# 267 | UTC_TIME="$(TZ='UTC' date +'%Y_%m_%dT%I_%M_%S_%p')" 268 | echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}" 269 | continue-on-error: true 270 | 271 | - name: Upload (x86_64-Linux) Artifacts 272 | uses: actions/upload-artifact@v4 273 | with: 274 | name: Pkgcache_x86_64-Linux 275 | path: | 276 | /tmp/BUILD.log 277 | compression-level: 0 # no compression, [Default: 6 (GNU Gzip)] 278 | retention-days: 30 279 | overwrite: true 280 | continue-on-error: true 281 | 282 | - name: Attest Build Provenance 283 | uses: actions/attest-build-provenance@v2.3.0 284 | with: 285 | subject-name: "build-logs-x86_64-Linux-${{ env.UTC_TIME }}" 286 | subject-path: "/tmp/BUILD.log" 287 | show-summary: true 288 | continue-on-error: true 289 | #------------------------------------------------------------------------------------# 290 | - name: Notify Discord [Completion] 291 | if: env.NOTIFY_DISCORD != 'NO' 292 | run: | 293 | ##presets 294 | set +x ; set +e 295 | #-------------# 296 | pushd "$(mktemp -d)" >/dev/null 2>&1 297 | #Setup Config 298 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" 299 | echo 'discord:' > "./notify.yaml" 300 | echo ' - id: "portable-apps"' >> "./notify.yaml" 301 | echo ' discord_channel: "main"' >> "./notify.yaml" 302 | echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" 303 | echo ' discord_format: "{{data}}"' >> "./notify.yaml" 304 | echo " discord_webhook_url: \"${{ secrets.DISCORD_NOTIFY }}\"" >> "./notify.yaml" 305 | #Prep Body 306 | ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" 307 | END_TIME="$(date +%s)" && export END_TIME="${END_TIME}" 308 | SECS="$((END_TIME - START_TIME))" 309 | #ELAPSED_TIME="$(date -u -d@"$((END_TIME - START_TIME))" "+%H(Hr):%M(Min):%S(Sec)")" 310 | ELAPSED_TIME="$((SECS/86400))(Day):$(date -u -d@$((SECS%86400)) '+%H(Hr):%M(Min):%S(Sec)')" 311 | echo "ELAPSED_TIME=${ELAPSED_TIME}" >> "${GITHUB_ENV}" 312 | rm -rvf "/tmp/PKGFORGE_DISCORD.md" 2>/dev/null 313 | echo 'ℹ️ **Completed** [🛍️ Build 📦 Pkgcache] (Weekly) ==> https://github.com/pkgforge/pkgcache/blob/main/.github/workflows/build_x86_64_Linux.yaml `['"$(date --utc +'%Y-%m-%dT%H:%M:%S.%3N')"' UTC]`' > "/tmp/PKGFORGE_DISCORD.md" 314 | echo '**`Host`**: `x86_64-Linux`' >> "/tmp/PKGFORGE_DISCORD.md" 315 | echo '**`Event`**: `'"${GH_EVENT}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 316 | echo '**`Logs (VERBOSE)`**: https://bin.pkgforge.dev/x86_64-Linux/BUILD.log.txt' >> "/tmp/PKGFORGE_DISCORD.md" 317 | if [[ "${BUILD_FAILED}" == "YES" ]]; then 318 | echo '**`Logs (FAILED)`**: https://bin.pkgforge.dev/x86_64-Linux/BUILD_FAILED.log.txt' >> "/tmp/PKGFORGE_DISCORD.md" 319 | fi 320 | #echo '**`Workflow`**: "'${GH_WORKFLOW_URL}'"' >> "/tmp/PKGFORGE_DISCORD.md" 321 | echo '**`Workflow`**: '${GH_WORKFLOW_URL}' ' >> "/tmp/PKGFORGE_DISCORD.md" 322 | echo '**`Maintainer`**: @Azathothas' >> "/tmp/PKGFORGE_DISCORD.md" 323 | echo '**`Packages (pkg_family)`**: `'"Total: ${GH_RECIPE_COUNT} (Disabled: ${GH_DISABLED_COUNT}) (Rebuilt: ${GH_REBUILD_COUNT})"'`' >> "/tmp/PKGFORGE_DISCORD.md" 324 | echo '**`Packages (Make these PUBLIC)`**: https://github.com/orgs/pkgforge/packages?visibility=private' >> "/tmp/PKGFORGE_DISCORD.md" 325 | echo '**`Preserved TMPFILES?`**: `'"${KEEP_LOGS}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 326 | echo '**`Rebuilt?`**: `'"${FORCE_REBUILD_ALL}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 327 | echo '**`Total Time`**: `'"${ELAPSED_TIME}"'`' >> "/tmp/PKGFORGE_DISCORD.md" 328 | cat "${SYSTMP}/BUILD.log" | grep -i 'FATAL' | sed -E 's/.*Could NOT Build ([a-z0-9]*\.static).*?(https.*\.yaml\])/\1 [\2/' > "./FAILED.txt" 329 | if [[ -s "./FAILED.txt" && $(stat -c%s "./FAILED.txt") -gt 10 ]]; then 330 | echo '**`Failed Builds`**: ==>' >> "/tmp/PKGFORGE_DISCORD.md" 331 | cat "./FAILED.txt" >> "/tmp/PKGFORGE_DISCORD.md" 332 | fi 333 | cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check 334 | echo -e "\n\n" && cat "/tmp/PKGFORGE_DISCORD.md" && echo -e "\n\n" 335 | popd >/dev/null 2>&1 336 | continue-on-error: true 337 | #------------------------------------------------------------------------------------# -------------------------------------------------------------------------------- /.github/workflows/check_links.yaml: -------------------------------------------------------------------------------- 1 | #https://github.com/lycheeverse/lychee-action 2 | name: 🔎 Check Links 🔗 3 | 4 | on: 5 | repository_dispatch: 6 | workflow_dispatch: 7 | schedule: 8 | - cron: "15 0 * * 1" #12:15 AM UTC --> 06:00 AM NPT Tue 9 | 10 | jobs: 11 | linkChecker: 12 | runs-on: ubuntu-latest 13 | permissions: 14 | issues: write 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | path: main 19 | filter: "blob:none" 20 | 21 | - name: Link Checker 22 | id: lychee 23 | uses: lycheeverse/lychee-action@v2 24 | with: 25 | fail: false 26 | 27 | - name: Create Issue From File 28 | if: steps.lychee.outputs.exit_code != 0 29 | uses: peter-evans/create-issue-from-file@v5 30 | with: 31 | title: Link Checker Report 32 | content-filepath: ./lychee/out.md 33 | labels: report, automated issue 34 | -------------------------------------------------------------------------------- /.github/workflows/kill_all_actions.yaml: -------------------------------------------------------------------------------- 1 | #!!WARNING: This kills All actions (all kinds) in the entire repository## 2 | name: 🔫 Kill All Actions 👾 3 | on: 4 | workflow_dispatch: 5 | jobs: 6 | KIA: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | actions: write 10 | statuses: write 11 | steps: 12 | - name: Kill 13 | run: | 14 | ##presets 15 | set +x ; set +e 16 | #-------------# 17 | ##Stale 18 | kill_all_actions() 19 | { 20 | gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'stale' |\ 21 | xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & 22 | ##Queued 23 | gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'queued' |\ 24 | xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & 25 | ##Requested 26 | gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'requested' |\ 27 | xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & 28 | ##Waiting 29 | gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'waiting' |\ 30 | xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & 31 | ##In_Progress (Must be last) 32 | gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'in_progress' |\ 33 | xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & 34 | ##Wait 35 | wait ; echo 36 | } 37 | export -f kill_all_actions 38 | kill_all_actions ; kill_all_actions ; kill_all_actions 39 | continue-on-error: true -------------------------------------------------------------------------------- /.github/workflows/matrix_builds.yaml: -------------------------------------------------------------------------------- 1 | name: 🧰🛠️ Build Package 📦📀 2 | 3 | permissions: 4 | contents: write 5 | 6 | on: 7 | workflow_dispatch: 8 | inputs: 9 | 10 | host: 11 | description: Host (Arch+OS) [ALL ==> Run on All Hosts (No riscv64)] 12 | type: choice 13 | options: 14 | - "ALL" 15 | - "aarch64-Linux" 16 | - "riscv64-Linux" 17 | - "x86_64-Linux" 18 | 19 | sbuild-url: 20 | description: Raw URL where SBUILD is located 21 | required: true 22 | 23 | ghcr-url: 24 | description: Root GHCR URL under which this package will be pushed 25 | required: true 26 | 27 | pkg-family: 28 | description: Package Family 29 | required: true 30 | 31 | ci-infra: 32 | description: CI Infra (What Build Servers to Use) [Default ==> GitHub] 33 | type: choice 34 | options: 35 | - "github" 36 | - "circle-ci" 37 | - "self-hosted" 38 | 39 | debug: 40 | description: Debug Mode (Verbose with set -x) [Default ==> False] 41 | type: choice 42 | options: 43 | - "false" 44 | - "true" 45 | 46 | logs: 47 | description: Keep Logs? (Preserves Working Dir) [Default ==> True] 48 | type: choice 49 | options: 50 | - "true" 51 | - "false" 52 | 53 | rebuild: 54 | description: Force Rebuild this Package? [Default ==> True] 55 | type: choice 56 | options: 57 | - "true" 58 | - "false" 59 | jobs: 60 | preprocess: 61 | runs-on: ubuntu-latest 62 | outputs: 63 | runner_matrix: ${{ steps.generate-matrix.outputs.runner_matrix }} 64 | steps: 65 | - name: Presetup 66 | id: generate-matrix 67 | run: | 68 | ##Presets 69 | set +x ; set +e 70 | #-------------# 71 | echo '[' > "./MATRIX.json.tmp" 72 | if [[ "${{ github.event.inputs.ci-infra }}" == "github" || -z "${{ github.event.inputs.ci-infra }}" ]]; then 73 | if [[ "${{ github.event.inputs.host }}" == "ALL" ]]; then 74 | echo '{"host": "aarch64-Linux", "runner": "ubuntu-24.04-arm", "ghcr_pkg": "${{ inputs.ghcr-url }}"},' >> "./MATRIX.json.tmp" 75 | #echo '{"host": "riscv64-Linux", "runner": "ubuntu-latest", "ghcr_pkg": "${{ inputs.ghcr-url }}"},' >> "./MATRIX.json.tmp" 76 | echo '{"host": "x86_64-Linux", "runner": "ubuntu-latest", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 77 | elif [[ "${{ github.event.inputs.host }}" == "aarch64-Linux" ]]; then 78 | echo '{"host": "aarch64-Linux", "runner": "ubuntu-24.04-arm", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 79 | elif [[ "${{ github.event.inputs.host }}" == "riscv64-Linux" ]]; then 80 | echo '{"host": "riscv64-Linux", "runner": "ubuntu-latest", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 81 | elif [[ "${{ github.event.inputs.host }}" == "x86_64-Linux" ]]; then 82 | echo '{"host": "x86_64-Linux", "runner": "ubuntu-latest", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 83 | fi 84 | elif [[ "${{ github.event.inputs.ci-infra }}" == "circle-ci" ]]; then 85 | curl -X "POST" -H "content-type: application/json" -qfsSL "${{ secrets.CIRCLE_CI_WEBHOOK_URL }}?secret=${{ secrets.CIRCLE_CI_SECRET }}" 86 | if [[ "${{ github.event.inputs.host }}" == "ALL" ]]; then 87 | echo '{"host": "aarch64-Linux", "runner": "arm64-linux-circle", "ghcr_pkg": "${{ inputs.ghcr-url }}"},' >> "./MATRIX.json.tmp" 88 | #echo '{"host": "riscv64-Linux", "runner": "amd64-linux-circle", "ghcr_pkg": "${{ inputs.ghcr-url }}"},' >> "./MATRIX.json.tmp" 89 | echo '{"host": "x86_64-Linux", "runner": "amd64-linux-circle", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 90 | elif [[ "${{ github.event.inputs.host }}" == "aarch64-Linux" ]]; then 91 | echo '{"host": "aarch64-Linux", "runner": "arm64-linux-circle", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 92 | elif [[ "${{ github.event.inputs.host }}" == "riscv64-Linux" ]]; then 93 | echo '{"host": "riscv64-Linux", "runner": "amd64-linux-circle", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 94 | elif [[ "${{ github.event.inputs.host }}" == "x86_64-Linux" ]]; then 95 | echo '{"host": "x86_64-Linux", "runner": "amd64-linux-circle", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 96 | fi 97 | elif [[ "${{ github.event.inputs.ci-infra }}" == "self-hosted" ]]; then 98 | echo "" 99 | if [[ "${{ github.event.inputs.host }}" == "ALL" ]]; then 100 | echo '{"host": "aarch64-Linux", "runner": "self-hosted-aarch64", "ghcr_pkg": "${{ inputs.ghcr-url }}"},' >> "./MATRIX.json.tmp" 101 | #echo '{"host": "riscv64-Linux", "runner": "self-hosted-riscv64", "ghcr_pkg": "${{ inputs.ghcr-url }}"},' >> "./MATRIX.json.tmp" 102 | echo '{"host": "x86_64-Linux", "runner": "self-hosted-x86_64", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 103 | elif [[ "${{ github.event.inputs.host }}" == "aarch64-Linux" ]]; then 104 | echo '{"host": "aarch64-Linux", "runner": "self-hosted-aarch64", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 105 | elif [[ "${{ github.event.inputs.host }}" == "riscv64-Linux" ]]; then 106 | echo '{"host": "riscv64-Linux", "runner": "self-hosted-riscv64", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 107 | elif [[ "${{ github.event.inputs.host }}" == "x86_64-Linux" ]]; then 108 | echo '{"host": "x86_64-Linux", "runner": "self-hosted-x86_64", "ghcr_pkg": "${{ inputs.ghcr-url }}"}' >> "./MATRIX.json.tmp" 109 | fi 110 | fi 111 | echo ']' >> "./MATRIX.json.tmp" 112 | jq 'unique_by(.host)' "./MATRIX.json.tmp" | jq . > "./MATRIX.json" 113 | ESCAPED_MATRIX="$(cat "./MATRIX.json" | jq -c .)" 114 | echo "runner_matrix=${ESCAPED_MATRIX}" >> "${GITHUB_OUTPUT}" 115 | continue-on-error: false 116 | 117 | - name: Sanity Check Input JSON 118 | run: | 119 | echo '${{ steps.generate-matrix.outputs.runner_matrix }}' | jq . 120 | continue-on-error: true 121 | 122 | build: 123 | needs: [preprocess] 124 | strategy: 125 | fail-fast: false 126 | matrix: 127 | package: ${{ fromJson(needs.preprocess.outputs.runner_matrix) }} 128 | name: "${{ matrix.package.host }} ==> (${{ matrix.package.ghcr_pkg }})" 129 | runs-on: "${{ matrix.package.runner }}" 130 | timeout-minutes: 200 131 | permissions: 132 | attestations: write 133 | contents: write 134 | id-token: write 135 | packages: write 136 | steps: 137 | - name: Exit if not called 138 | env: 139 | GH_TOKEN: "${{ github.token }}" 140 | run: | 141 | ##Presets 142 | set +x ; set +e 143 | #-------------# 144 | if [[ "$(uname -m | tr -d '[:space:]')" == "aarch64" ]]; then 145 | if [[ "${{ github.event.inputs.host }}" != "ALL" ]] && [[ "${{ github.event.inputs.host }}" != "aarch64-Linux" ]]; then 146 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 147 | fi 148 | elif [[ "$(uname -m | tr -d '[:space:]')" == "riscv64" ]]; then 149 | if [[ "${{ github.event.inputs.host }}" != "ALL" ]] && [[ "${{ github.event.inputs.host }}" != "riscv64-Linux" ]]; then 150 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 151 | fi 152 | elif [[ "$(uname -m | tr -d '[:space:]')" == "x86_64" ]]; then 153 | if [[ "${{ github.event.inputs.host }}" != "ALL" ]] && [[ "${{ github.event.inputs.host }}" != "x86_64-Linux" ]]; then 154 | if [[ "${{ github.event.inputs.host }}" == "riscv64-Linux" ]]; then 155 | echo "CONTINUE_GHRUN=TRUE" >> "${GITHUB_ENV}" 156 | else 157 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 158 | fi 159 | fi 160 | fi 161 | continue-on-error: false 162 | 163 | - name: Validate Required Secrets [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 164 | if: env.CONTINUE_GHRUN != 'FALSE' 165 | env: 166 | RO_GHTOKEN: ${{ secrets.RO_GHTOKEN }} 167 | RO_GLTOKEN: ${{ secrets.RO_GLTOKEN }} 168 | MINISIGN_KEY: ${{ secrets.MINISIGN_KEY }} 169 | run: | 170 | ##Presets 171 | set +x ; set +e 172 | #-------------# 173 | # Check if any of the required secrets are missing 174 | if [ -z "${RO_GHTOKEN##*[[:space:]]}" ] || [ -z "${RO_GLTOKEN##*[[:space:]]}" ] || [ -z "${MINISIGN_KEY##*[[:space:]]}" ]; then 175 | echo "::error::One or more required secrets are missing:" 176 | [ -z "${RO_GHTOKEN##*[[:space:]]}" ] && echo "- RO_GHTOKEN is missing" 177 | [ -z "${RO_GLTOKEN##*[[:space:]]}" ] && echo "- RO_GLTOKEN is missing" 178 | [ -z "${MINISIGN_KEY##*[[:space:]]}" ] && echo "- MINISIGN_KEY is missing" 179 | exit 1 180 | fi 181 | continue-on-error: false 182 | 183 | - name: Parse Input [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 184 | if: env.CONTINUE_GHRUN != 'FALSE' 185 | run: | 186 | ##Presets 187 | set +x ; set +e 188 | #-------------# 189 | ##Host Triplet 190 | if [[ "${{ matrix.package.host }}" == "riscv64-Linux" ]] ; then 191 | export HOST_TRIPLET="riscv64-Linux" 192 | if [[ "$(uname -m | tr -d '[:space:]')" == "riscv64" ]]; then 193 | export ON_QEMU="NO" 194 | else 195 | export ON_QEMU="YES" 196 | fi 197 | else 198 | export HOST_TRIPLET="$(uname -m)-$(uname -s)" 199 | export ON_QEMU="NO" 200 | fi 201 | echo "HOST_TRIPLET=${HOST_TRIPLET}" >> "${GITHUB_ENV}" 202 | echo "ON_QEMU=${ON_QEMU}" >> "${GITHUB_ENV}" 203 | ##Debug 204 | if [[ "${{ github.event.inputs.debug }}" == "true" ]] ; then 205 | export DEBUG="1" 206 | else 207 | export DEBUG="0" 208 | fi 209 | echo "DEBUG=${DEBUG}" >> "${GITHUB_ENV}" 210 | ##GHCRPKG_URL 211 | GHCRPKG_LOCAL="$(echo "${{ inputs.ghcr-url }}" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')" 212 | export GHCRPKG_LOCAL 213 | echo "GHCRPKG_LOCAL=${GHCRPKG_LOCAL}" >> "${GITHUB_ENV}" 214 | ##Logs 215 | if [[ "${{ github.event.inputs.logs }}" == "false" ]] ; then 216 | export KEEP_LOGS="NO" 217 | else 218 | export KEEP_LOGS="YES" 219 | export GITHUB_TEST_BUILD="YES" 220 | fi 221 | echo "KEEP_LOGS=${KEEP_LOGS}" >> "${GITHUB_ENV}" 222 | echo "GITHUB_TEST_BUILD=${GITHUB_TEST_BUILD}" >> "${GITHUB_ENV}" 223 | ##PKG_FAMILY_LOCAL 224 | PKG_FAMILY_LOCAL="$(echo "${{ inputs.pkg-family }}" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')" 225 | export PKG_FAMILY_LOCAL 226 | echo "PKG_FAMILY_LOCAL=${PKG_FAMILY_LOCAL}" >> "${GITHUB_ENV}" 227 | ##Rebuild 228 | if [[ "${{ github.event.inputs.rebuild }}" == "false" ]] ; then 229 | export SBUILD_REBUILD="false" 230 | else 231 | export SBUILD_REBUILD="true" 232 | fi 233 | echo "SBUILD_REBUILD=${SBUILD_REBUILD}" >> "${GITHUB_ENV}" 234 | ##SBUILD_URL 235 | sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/yq" -o "/usr/local/bin/yq" && \ 236 | sudo chmod 'a+x' "/usr/local/bin/yq" && command -v yq >/dev/null || exit 1 237 | SBUILD_FILE_URL="$(echo "${{ github.event.inputs.sbuild-url }}" | tr -d '[:space:]')" 238 | pushd "$(mktemp -d)" >/dev/null 2>&1 239 | curl -w "(SBUILD) <== %{url}\n" -fL "${SBUILD_FILE_URL}" -o "./SBUILD_INPUT" 240 | if [[ ! -s "./SBUILD_INPUT" || $(stat -c%s "./SBUILD_INPUT") -le 10 ]]; then 241 | echo -e "\n[✗] FATAL: Failed to Fetch ${SBUILD_FILE_URL}\n" 242 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 243 | exit 1 244 | else 245 | export SBUILD_FILE_URL 246 | echo "SBUILD_FILE_URL=${SBUILD_FILE_URL}" >> "${GITHUB_ENV}" 247 | #Check for x_exec.host 248 | if yq e '.x_exec.host != null' "./SBUILD_INPUT" | grep -qi 'true'; then 249 | if ! yq '.x_exec.host[]' "./SBUILD_INPUT" | grep -v '^#' | grep -qi "${HOST_TRIPLET,,}"; then 250 | echo -e "\n[✗] WARNING: SBUILD (./SBUILD_INPUT) is NOT Supported on ${HOST_TRIPLET}\n" 251 | yq '.x_exec.host[]' "./SBUILD_INPUT" 252 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 253 | fi 254 | fi 255 | fi 256 | popd >/dev/null 2>&1 257 | continue-on-error: false 258 | 259 | - name: Setup Env [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 260 | if: env.CONTINUE_GHRUN != 'FALSE' 261 | run: | 262 | ##Presets 263 | set +x ; set +e 264 | #-------------# 265 | ##Debug? 266 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 267 | set -x 268 | fi 269 | #-------------# 270 | ##CoreUtils 271 | sudo apt update -y 272 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 273 | sudo apt install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt update -y 2>/dev/null 274 | ##tmp 275 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 276 | #GH ENV 277 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 278 | echo "GHA_MODE=MATRIX" >> "${GITHUB_ENV}" 279 | #-------------# 280 | mkdir -p "${HOME}/bin" 281 | sudo apt update -y 282 | sudo apt install dos2unix -y 283 | ##Setup Minisign 284 | mkdir -pv "${HOME}/.minisign" 285 | echo "${{ secrets.MINISIGN_SIGKEY }}" > "${HOME}/.minisign/pkgforge.key" 286 | ##User-Agent 287 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 288 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 289 | continue-on-error: true 290 | 291 | - name: Disable apparmor_restrict_unprivileged_userns #Required for runimage etc 292 | if: env.CONTINUE_GHRUN != 'FALSE' 293 | run: | 294 | ##Presets 295 | set +x ; set +e 296 | #-------------# 297 | ##Debug? 298 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 299 | set -x 300 | fi 301 | #-------------# 302 | echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee "/etc/sysctl.d/98-apparmor-unuserns.conf" 303 | echo "0" | sudo tee "/proc/sys/kernel/apparmor_restrict_unprivileged_userns" 304 | sudo service procps restart 305 | sudo sysctl -p "/etc/sysctl.conf" 306 | continue-on-error: true 307 | 308 | - name: If riscv64 on QEMU [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 309 | if: env.HOST_TRIPLET == 'riscv64-Linux' && env.ON_QEMU == 'YES' && env.CONTINUE_GHRUN != 'FALSE' 310 | env: 311 | #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" #Needs Actions' Token if we want to make the packages public 312 | GHCR_TOKEN: "${{ github.token }}" 313 | run: | 314 | ##Presets 315 | set +x ; set +e 316 | #-------------# 317 | ##Debug? 318 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 319 | set -x 320 | fi 321 | #-------------# 322 | echo "RISCV64_ON_QEMU=TRUE" >> "${GITHUB_ENV}" 323 | echo "INSIDE_PODMAN=TRUE" >> "${GITHUB_ENV}" 324 | bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Linux/install_bins_curl.sh") 325 | echo "${GHCR_TOKEN}" | oras login --username "Azathothas" --password-stdin "ghcr.io" 326 | continue-on-error: true 327 | 328 | - name: Set up QEMU [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 329 | if: env.RISCV64_ON_QEMU == 'TRUE' && env.CONTINUE_GHRUN != 'FALSE' 330 | uses: docker/setup-qemu-action@v3 331 | continue-on-error: true 332 | - name: Set up Cross Arch [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 333 | if: env.RISCV64_ON_QEMU == 'TRUE' && env.CONTINUE_GHRUN != 'FALSE' 334 | uses: docker/setup-buildx-action@v3 335 | continue-on-error: true 336 | 337 | - name: Install/Configure Podman [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 338 | if: env.RISCV64_ON_QEMU == 'TRUE' && env.CONTINUE_GHRUN != 'FALSE' 339 | run: | 340 | ##Presets 341 | set +x ; set +e 342 | #-------------# 343 | ##Debug? 344 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 345 | set -x 346 | fi 347 | #-------------# 348 | if ! command -v podman &>/dev/null; then 349 | echo -e "\n[-] Failed to find podman\n" 350 | #Install Manually 351 | sudo apt update -y -qq 352 | sudo apt install podman -y -qq 353 | if ! command -v podman &>/dev/null; then 354 | echo -e "\n[-] Failed to install Podman\n" 355 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 356 | exit 1 357 | else 358 | cat "$(systemctl show podman.service -p FragmentPath 2>/dev/null | cut -d '=' -f 2 | tr -d '[:space:]')" 359 | sudo systemctl daemon-reexec ; sudo systemctl daemon-reload 360 | sudo systemctl status podman --no-pager 361 | sudo systemctl reload "podman.service" 362 | sudo service podman reload ; sudo service podman restart ; sudo systemctl status podman --no-pager 363 | fi 364 | else 365 | podman info 366 | podman version 367 | fi 368 | continue-on-error: true 369 | 370 | - name: Daemonize Podman [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 371 | if: env.RISCV64_ON_QEMU == 'TRUE' && env.CONTINUE_GHRUN != 'FALSE' 372 | run: | 373 | ##Presets 374 | set +x ; set +e 375 | #-------------# 376 | ##Debug? 377 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 378 | set -x 379 | fi 380 | #-------------# 381 | ##Get Env 382 | env 1>"./env.list" 2>"/dev/null" 383 | ##Run 384 | sudo mkdir -p "/var/lib/containers/tmp-runner01" 385 | sudo chmod 1777 -v "/var/lib/containers/tmp-runner01" 386 | POD_IMAGE="ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:riscv64" 387 | sudo podman run --platform="linux/riscv64" --detach --privileged \ 388 | --device "/dev/fuse" --env-file="env.list" --hostname "$(hostname)" --name="ubuntu-builder" \ 389 | --network="bridge" --pull="always" --systemd="always" --tz="UTC" --ulimit="host" \ 390 | --volume "${HOME}/.minisign:/home/runner/.minisign" \ 391 | --volume "/var/lib/containers/tmp-runner01:/tmp:rw,exec,dev" "${POD_IMAGE}" 392 | rm -rf "./env.list" 2>/dev/null 393 | sleep 10 394 | POD_ID="$(sudo podman ps --filter "name=ubuntu-builder" --format json 2>/dev/null | jq --arg P_IMG "${POD_IMAGE}" -r '.[] | select(.Image == $P_IMG) | .Id' | tr -d '"'\''[:space:]')" 395 | if ! sudo podman inspect "${POD_ID}" &>/dev/null; then 396 | echo -e "\n[✗] FATAL: Could NOT find \${POD_ID}\n" 397 | podman ps -a 398 | echo "CONTINUE_GHRUN=FALSE" >> "${GITHUB_ENV}" 399 | exit 1 400 | else 401 | echo "POD_IMAGE=${POD_IMAGE}" >> "${GITHUB_ENV}" 402 | echo "POD_ID=${POD_ID}" >> "${GITHUB_ENV}" 403 | sudo podman exec -it -u "runner" "${POD_ID}" bash -c 'echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee "/etc/sysctl.d/98-apparmor-unuserns.conf"' 404 | sudo podman exec -it -u "runner" "${POD_ID}" bash -c 'echo "0" | sudo tee "/proc/sys/kernel/apparmor_restrict_unprivileged_userns"' 405 | #sudo podman exec -it -u "runner" "${POD_ID}" bash -c 'sudo service procps restart' 406 | sudo podman exec -it -u "runner" "${POD_ID}" bash -c 'sudo sysctl -p "/etc/sysctl.conf"' 407 | sudo podman exec -it -u "runner" "${POD_ID}" bash -c \ 408 | ' 409 | sudo apt update -y 410 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 411 | sudo apt install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt update -y 2>/dev/null 412 | mkdir -p "${HOME}/bin" 413 | sudo apt update -y 414 | sudo apt install dos2unix -y 415 | ' 416 | fi 417 | continue-on-error: true 418 | 419 | - name: BUILD (${{ env.GHCRPKG_LOCAL }}) [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 420 | if: env.CONTINUE_GHRUN != 'FALSE' 421 | env: 422 | #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" #Needs Actions' Token if we want to make the packages public 423 | GHCR_TOKEN: "${{ github.token }}" 424 | GITHUB_TOKEN: "${{ secrets.RO_GHTOKEN }}" 425 | GITLAB_TOKEN: "${{ secrets.RO_GLTOKEN }}" 426 | MINISIGN_KEY: "${{ secrets.MINISIGN_KEY }}" 427 | run: | 428 | ##Presets 429 | set +x ; set +e 430 | #-------------# 431 | ##Debug? 432 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 433 | set -x 434 | fi 435 | #-------------# 436 | ##Main 437 | pushd "$(mktemp -d)" >/dev/null 2>&1 438 | curl -qfsSL "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/runner/builder.sh" -o "${SYSTMP}/BUILDER.sh" 439 | dos2unix --quiet "${SYSTMP}/BUILDER.sh" ; chmod +xwr "${SYSTMP}/BUILDER.sh" 440 | ##Run with STDOUT + LOGS 441 | export DEBUG="${DEBUG}" 442 | export KEEP_LOGS="${KEEP_LOGS}" 443 | export PKG_FAMILY_LOCAL="${PKG_FAMILY_LOCAL}" 444 | export GHCRPKG_LOCAL="${GHCRPKG_LOCAL}" 445 | export SBUILD_REBUILD="${SBUILD_REBUILD}" 446 | export GITHUB_TEST_BUILD="${GITHUB_TEST_BUILD}" 447 | if [[ "${{ env.RISCV64_ON_QEMU }}" == "TRUE" ]]; then 448 | sudo podman cp "${SYSTMP}/BUILDER.sh" "${POD_ID}:/tmp/BUILDER.sh" 449 | sudo podman exec -u "runner" -w "/tmp" \ 450 | -e DEBUG="${DEBUG}" \ 451 | -e GHCR_TOKEN="${GHCR_TOKEN}" \ 452 | -e GITHUB_TOKEN="${GITHUB_TOKEN}" \ 453 | -e GITLAB_TOKEN="${GITLAB_TOKEN}" \ 454 | -e MINISIGN_KEY="${MINISIGN_KEY}" \ 455 | -e KEEP_LOGS="${KEEP_LOGS}" \ 456 | -e PKG_FAMILY_LOCAL="${PKG_FAMILY_LOCAL}" \ 457 | -e GHCRPKG_LOCAL="${GHCRPKG_LOCAL}" \ 458 | -e SBUILD_REBUILD="${SBUILD_REBUILD}" \ 459 | -e GITHUB_TEST_BUILD="${GITHUB_TEST_BUILD}" \ 460 | -e INSIDE_PODMAN="${INSIDE_PODMAN}" \ 461 | -e SBUILD_FILE_URL="${SBUILD_FILE_URL}" \ 462 | "${POD_ID}" \ 463 | bash -c 'bash "/tmp/BUILDER.sh" "${SBUILD_FILE_URL}" | tee "/tmp/BUILD.log" 2>&1' 464 | sudo podman cp "${POD_ID}:/tmp/BUILD.log" "${SYSTMP}/BUILD.log" 465 | sudo podman cp "${POD_ID}:/tmp/BUILD_ARTIFACTS.zstd" "${SYSTMP}/BUILD_ARTIFACTS.zstd" 466 | sudo podman cp "${POD_ID}:/tmp/GITHUB_ENV" "${SYSTMP}/GITHUB_ENV" 467 | mkdir -p "${SYSTMP}/_POD_BRIDGE" 468 | sudo podman cp "${POD_ID}:/tmp/_POD_BRIDGE/." "${SYSTMP}/_POD_BRIDGE" 469 | sudo chown -Rv "$(whoami):$(whoami)" "${SYSTMP}/BUILD.log" "${SYSTMP}/BUILD_ARTIFACTS.zstd" "${SYSTMP}/GITHUB_ENV" "${SYSTMP}/_POD_BRIDGE" 2>/dev/null 470 | sudo chmod -R +xwr "${SYSTMP}/BUILD.log" "${SYSTMP}/BUILD_ARTIFACTS.zstd" "${SYSTMP}/GITHUB_ENV" "${SYSTMP}/_POD_BRIDGE" 2>/dev/null 471 | cat "${SYSTMP}/GITHUB_ENV" >> "${GITHUB_ENV}" 472 | else 473 | bash "${SYSTMP}/BUILDER.sh" "${SBUILD_FILE_URL}" | tee "${SYSTMP}/BUILD.log" 2>&1 474 | fi 475 | ##Purge Tokens (in case set -x & gh didn't redact) 476 | cat "${SYSTMP}/BUILD.log" | ansi2txt > "${SYSTMP}/BUILD.gh.log.txt" 477 | sed -i '/.*github_pat.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 478 | sed -i '/.*ghp_.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 479 | sed -i '/.*access_key_id.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 480 | sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 481 | sed -i '/.*secret_access_key.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 482 | sed -i '/.*token.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 483 | sed -i '/.*cloudflarestorage.*/Id' "${SYSTMP}/BUILD.gh.log.txt" 2>/dev/null 484 | mv -fv "${SYSTMP}/BUILD.gh.log.txt" "${SYSTMP}/BUILD.log" 485 | popd >/dev/null 2>&1 486 | continue-on-error: true 487 | 488 | - name: Push Artifacts (${{ env.GHCRPKG_LOCAL }}) [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 489 | if: env.CONTINUE_GHRUN != 'FALSE' 490 | env: 491 | #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" #Needs Actions' Token if we want to make the packages public 492 | GHCR_TOKEN: "${{ github.token }}" 493 | GITHUB_TOKEN: "${{ secrets.RO_GHTOKEN }}" 494 | GITLAB_TOKEN: "${{ secrets.RO_GLTOKEN }}" 495 | MINISIGN_KEY: "${{ secrets.MINISIGN_KEY }}" 496 | run: | 497 | ##Presets 498 | set +x ; set +e 499 | #-------------# 500 | ##Debug? 501 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 502 | set -x 503 | fi 504 | #-------------# 505 | ##Set ENV 506 | if [[ "${SKIP_SRCBUILD_UPLOAD}" != "YES" ]]; then 507 | #GHCRPKG_TAG_SRCBUILD="srcbuild.$(date --utc +"%y%m%dT%H%M%S" | tr -d '[:space:]')-${{ env.GHCRPKG_TAG }}" 508 | GHCRPKG_TAG_SRCBUILD="${{ env.GHCRPKG_TAG }}" 509 | GHCRPKG_URL_SRCBUILD="${{ env.GHCRPKG_LOCAL }}/${{ env.PKG_FAMILY_LOCAL }}-srcbuild-${{ env.BUILD_ID }}" 510 | export GHCRPKG_TAG_SRCBUILD GHCRPKG_URL_SRCBUILD 511 | echo "GHCRPKG_TAG_SRCBUILD=${GHCRPKG_TAG_SRCBUILD}" >> "${GITHUB_ENV}" 512 | echo "GHCRPKG_URL_SRCBUILD=${GHCRPKG_URL_SRCBUILD}" >> "${GITHUB_ENV}" 513 | fi 514 | ##Push 515 | if [[ -n "${GHCRPKG_TAG_SRCBUILD+x}" ]]; then 516 | pushd "/tmp" &>/dev/null 517 | if [[ -s "./BUILD_ARTIFACTS.zstd" && $(stat -c%s "./BUILD_ARTIFACTS.zstd") -gt 1000 ]]; then 518 | realpath "./BUILD_ARTIFACTS.zstd" && du -sh "./BUILD_ARTIFACTS.zstd" 519 | ls -sh "${{ env.SBUILD_OUTDIR }}" 520 | ghcr_push_cmd() 521 | { 522 | for i in {1..10}; do 523 | unset ghcr_push ; ghcr_push=(oras push --disable-path-validation) 524 | ghcr_push+=(--config "/dev/null:application/vnd.oci.empty.v1+json") 525 | ghcr_push+=(--annotation "com.github.package.type=container") 526 | ghcr_push+=(--annotation "dev.pkgforge.soar.build_ghcrpkg-tag=${{ env.GHCRPKG_TAG }}") 527 | ghcr_push+=(--annotation "dev.pkgforge.soar.build_gha=${{ env.BUILD_GHACTIONS }}") 528 | ghcr_push+=(--annotation "dev.pkgforge.soar.build_id=${{ env.BUILD_ID }}") 529 | ghcr_push+=(--annotation "dev.pkgforge.soar.ghcr_pkg=${{ env.GHCRPKG_URL }}:${{ env.GHCRPKG_TAG }}") 530 | ghcr_push+=(--annotation "dev.pkgforge.soar.push_date=${{ env.PKG_DATE }}") 531 | ghcr_push+=(--annotation "dev.pkgforge.soar.version=${{ env.PKG_VERSION }}") 532 | ghcr_push+=(--annotation "org.opencontainers.image.created=${{ env.PKG_DATE }}") 533 | ghcr_push+=(--annotation "org.opencontainers.image.description=SRCBUILD for ${{ env.GHCRPKG_URL }}") 534 | ghcr_push+=(--annotation "org.opencontainers.image.licenses=blessing") 535 | ghcr_push+=(--annotation "org.opencontainers.image.ref.name=${{ env.PKG_VERSION }}") 536 | ghcr_push+=(--annotation "org.opencontainers.image.revision=${{ env.PKG_VERSION }}") 537 | ghcr_push+=(--annotation "org.opencontainers.image.source=${{ env.PKG_WEBPAGE }}") 538 | ghcr_push+=(--annotation "org.opencontainers.image.title=SRCBUILD-${{ env.PKG_FAMILY_LOCAL }}") 539 | ghcr_push+=(--annotation "org.opencontainers.image.url=${{ env.PKG_SRCURL }}") 540 | ghcr_push+=(--annotation "org.opencontainers.image.vendor=pkgforge") 541 | ghcr_push+=(--annotation "org.opencontainers.image.version=${{ env.PKG_VERSION }}") 542 | ghcr_push+=("${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}") 543 | [[ -f "./BUILD_ARTIFACTS.zstd" && -s "./BUILD_ARTIFACTS.zstd" ]] && ghcr_push+=("./BUILD_ARTIFACTS.zstd") 544 | "${ghcr_push[@]}" ; sleep 5 545 | #Check 546 | if [[ "$(oras manifest fetch "${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}" | jq -r '.annotations["dev.pkgforge.soar.push_date"]' | tr -d '[:space:]')" == "${{ env.PKG_DATE }}" ]]; then 547 | echo -e "\n[+] (ARTIFACTS) Registry --> https://${GHCRPKG_URL_SRCBUILD}\n" 548 | break 549 | else 550 | echo -e "\n[-] Failed to Push Artifact to ${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD} (Retrying ${i}/10)\n" 551 | fi 552 | sleep "$(shuf -i 500-4500 -n 1)e-3" 553 | done 554 | } 555 | export -f ghcr_push_cmd 556 | ghcr_push_cmd 557 | if [[ "$(oras manifest fetch "${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}" | jq -r '.annotations["dev.pkgforge.soar.push_date"]' | tr -d '[:space:]')" != "${{ env.PKG_DATE }}" ]]; then 558 | echo -e "\n[✗] Failed to Push Artifact to ${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}\n" 559 | echo -e "\n[-] Retrying ...\n" 560 | ghcr_push_cmd 561 | if [[ "$(oras manifest fetch "${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}" | jq -r '.annotations["dev.pkgforge.soar.push_date"]' | tr -d '[:space:]')" != "${{ env.PKG_DATE }}" ]]; then 562 | oras manifest fetch "${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}" | jq . 563 | echo -e "\n[✗] Failed to Push Artifact to ${GHCRPKG_URL_SRCBUILD}:${GHCRPKG_TAG_SRCBUILD}\n" 564 | return 1 || exit 1 565 | fi 566 | fi 567 | fi 568 | fi 569 | popd >/dev/null 2>&1 570 | continue-on-error: true 571 | 572 | ##Logs & Artifacts 573 | - name: Get DateTime [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 574 | if: env.CONTINUE_GHRUN != 'FALSE' 575 | run: | 576 | ##Presets 577 | set +x ; set +e 578 | #-------------# 579 | ##Debug? 580 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 581 | set -x 582 | fi 583 | #-------------# 584 | UTC_TIME="$(TZ='UTC' date +'%Y_%m_%dT%I_%M_%S_%p')" 585 | echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}" 586 | continue-on-error: true 587 | 588 | - name: Upload (LOG) Artifacts [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 589 | if: env.CONTINUE_GHRUN != 'FALSE' 590 | uses: actions/upload-artifact@v4 591 | with: 592 | name: Pkgcache_${{ env.PKG_FAMILY_LOCAL }}_${{ matrix.package.host }} 593 | path: | 594 | /tmp/BUILD.log 595 | /tmp/BUILD_ARTIFACTS.zstd 596 | compression-level: 0 # no compression, [Default: 6 (GNU Gzip)] 597 | retention-days: 30 598 | overwrite: true 599 | continue-on-error: true 600 | 601 | - name: Attest Build Provenance [${{ matrix.package.host }}<==>${{ matrix.package.runner }}] 602 | if: env.CONTINUE_GHRUN != 'FALSE' 603 | uses: actions/attest-build-provenance@v2.3.0 604 | with: 605 | subject-name: "${{ env.PKG_FAMILY_LOCAL }}-${{ env.BUILD_ID }}-${{ env.GHCRPKG_TAG }}" 606 | subject-path: | 607 | "/tmp/BUILD.log" 608 | "/tmp/BUILD_ARTIFACTS.zstd" 609 | ${{ env.SBUILD_OUTDIR }}/** 610 | !${{ env.SBUILD_TMPDIR }}/** 611 | show-summary: true 612 | continue-on-error: true 613 | 614 | - name: Check Build [${{ matrix.package.ghcr_pkg }}] 615 | if: env.CONTINUE_GHRUN != 'FALSE' 616 | run: | 617 | ##Presets 618 | set +x ; set +e 619 | #-------------# 620 | ##Debug? 621 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 622 | set -x 623 | fi 624 | #-------------# 625 | if [[ "${GHA_BUILD_FAILED}" == "YES" || "${SBUILD_SUCCESSFUL}" == "NO" ]]; then 626 | echo -e "\n[-] FATAL: Failed to Successfully Build ${{ matrix.package.ghcr_pkg }}" 627 | exit 1 628 | fi 629 | continue-on-error: false 630 | 631 | - name: Check Push [${{ matrix.package.ghcr_pkg }}] 632 | if: env.CONTINUE_GHRUN != 'FALSE' 633 | run: | 634 | ##Presets 635 | set +x ; set +e 636 | #-------------# 637 | ##Debug? 638 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 639 | set -x 640 | fi 641 | #-------------# 642 | if [[ "${PUSH_SUCCESSFUL}" == "NO" ]]; then 643 | echo -e "\n[-] FATAL: Failed to Successfully Push ==> ${{ matrix.package.ghcr_pkg }}" 644 | exit 1 645 | fi 646 | continue-on-error: false 647 | 648 | - name: Self-Kill 649 | if: always() 650 | run: | 651 | ##Presets 652 | set +x ; set +e 653 | #-------------# 654 | ##Debug? 655 | if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then 656 | set -x 657 | fi 658 | #-------------# 659 | [[ -f "/tmp/GHA_CI_STATUS" && -w "/tmp/GHA_CI_STATUS" ]] && echo "" > "/tmp/GHA_CI_STATUS" 660 | if [[ -d "/tmp" && -w "/tmp" ]]; then 661 | echo "EXITED" | tee "/tmp/GHA_CI_STATUS" 662 | fi 663 | continue-on-error: true -------------------------------------------------------------------------------- /.github/workflows/repo_linter.yaml: -------------------------------------------------------------------------------- 1 | name: 🐧🧹 Repo Linter 🖳🗑️ 2 | concurrency: 3 | group: "${{ github.workflow }}-${{ github.ref }}" 4 | cancel-in-progress: true 5 | #MAX_RUNTIME: 02 Minutes */10 * * * * 6 | 7 | on: 8 | #push: 9 | workflow_dispatch: 10 | schedule: 11 | # - cron: "45 03 * * *" # 03:45 AM UTC --> 09:30 AM Morning NPT 12 | - cron: "0 */8 * * *" # Every 12 Hrs 13 | 14 | #env: 15 | #GHCR_TOKEN: "${{ secrets.GHCR_TOKEN }}" 16 | jobs: 17 | #------------------------------------------------------------------------------------# 18 | check-post: 19 | runs-on: ubuntu-latest 20 | 21 | permissions: 22 | contents: write 23 | 24 | steps: 25 | - name: Debloat Runner 26 | run: | 27 | #Presets 28 | set +x ; set +e 29 | #--------------# 30 | bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/debloat_ubuntu.sh") 31 | continue-on-error: true 32 | 33 | - name: Checkout repository 34 | uses: actions/checkout@v4 35 | with: 36 | path: main 37 | filter: "blob:none" 38 | 39 | - name: Setup Env 40 | run: | 41 | ##presets 42 | set +x ; set +e 43 | #-------------# 44 | ##CoreUtils 45 | sudo apt update -y 46 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 47 | sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null 48 | #temp 49 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 50 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 51 | ##User-Agent 52 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 53 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 54 | continue-on-error: true 55 | 56 | - name: Install Addons 57 | run: | 58 | #presets 59 | set +x ; set +e 60 | #-------------# 61 | bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 62 | continue-on-error: true 63 | 64 | - name: Dos2Unix Everything 65 | run: | 66 | #Presets 67 | set +x ; set +e 68 | #--------------# 69 | cd "${GITHUB_WORKSPACE}/main" 70 | find . -type f ! -path "./.git/*" -exec dos2unix {} \; 2>/dev/null 71 | continue-on-error: true 72 | 73 | - name: ActionLint 74 | run: | 75 | #Presets 76 | set +x ; set +e 77 | #--------------# 78 | cd "${GITHUB_WORKSPACE}/main" 79 | find ".github/workflows" -type f -name "*ml" -exec actionlint {} \; 80 | continue-on-error: true 81 | 82 | - name: Blob Check 83 | run: | 84 | #Presets 85 | set +x ; set +e 86 | #--------------# 87 | sed 's|https://github.com/pkgforge/soarpkgs/blob/main/packages|https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/packages|g' -i "${GITHUB_WORKSPACE}/main/SBUILD_LIST.json" 88 | continue-on-error: true 89 | 90 | - name: Shellcheck 91 | run: | 92 | #Presets 93 | set +x ; set +e 94 | #--------------# 95 | cd "${GITHUB_WORKSPACE}/main" 96 | find ".github" -type f -name '*.sh' -exec shellcheck --exclude="SC2261" --severity=error "{}" \; 2>/dev/null | tee "${GITHUB_WORKSPACE}/main/.github/shellcheck.txt" 97 | continue-on-error: true 98 | 99 | - name: Gen Diff 100 | run: | 101 | #Presets 102 | set +x ; set +e 103 | #--------------# 104 | pushd "$(mktemp -d)" >/dev/null 2>&1 105 | curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/soarpkgs/data/DIFF_pkgcache.json" -o "./DIFF.json" 106 | cat "./DIFF.json" "${GITHUB_WORKSPACE}/main/SBUILD_LIST.json" | jq -s 'add | map(select(._disabled == false)) | sort_by(.pkg_family) | unique_by(.ghcr_pkg)' | jq . > "${GITHUB_WORKSPACE}/main/SBUILD_LIST.diff" 107 | sed 's|https://github.com/pkgforge/soarpkgs/blob/main/packages|https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/packages|g' -i "${GITHUB_WORKSPACE}/main/SBUILD_LIST.diff" 108 | cat "${GITHUB_WORKSPACE}/main/SBUILD_LIST.json" | jq 'group_by(.ghcr_pkg) | map(select(length > 1))' | jq . > "${GITHUB_WORKSPACE}/main/SBUILD_LIST.json.dupe" 109 | cat "${GITHUB_WORKSPACE}/main/SBUILD_LIST.diff" | jq 'group_by(.ghcr_pkg) | map(select(length > 1))' | jq . > "${GITHUB_WORKSPACE}/main/SBUILD_LIST.diff.dupe" 110 | popd >/dev/null 2>&1 111 | continue-on-error: true 112 | 113 | #- name: Generate Repo Metadata (git-sizer) 114 | # run: | 115 | # #Presets 116 | # set +x ; set +e 117 | # #--------------# 118 | # cd "${GITHUB_WORKSPACE}/main" 119 | # #Dust sizes 120 | # echo '```mathematica' > "${GITHUB_WORKSPACE}/main/.github/SIZE.md" 121 | # dust -b -c -i -r -n 99999999 "${GITHUB_WORKSPACE}/main" | tee -a "${GITHUB_WORKSPACE}/main/.github/SIZE.md" 122 | # dust -b -c -i -r -n 99999999 "${GITHUB_WORKSPACE}/main" | tee "${GITHUB_WORKSPACE}/main/.github/SIZE.txt" 123 | # echo '```' >> "${GITHUB_WORKSPACE}/main/.github/SIZE.md" 124 | # continue-on-error: true 125 | 126 | - name: Get DateTime & Purge files (=> 95 MB) 127 | run: | 128 | #Presets 129 | set +x ; set +e 130 | #--------------# 131 | UTC_TIME="$(TZ='UTC' date +'%Y-%m-%d (%I:%M:%S %p)')" 132 | echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}" 133 | #Purge 134 | find "${GITHUB_WORKSPACE}/main" -path "${GITHUB_WORKSPACE}/main/.git" -prune -o -type f -size +95M -exec rm -rvf "{}" + 2>/dev/null 135 | continue-on-error: true 136 | 137 | - uses: stefanzweifel/git-auto-commit-action@v5 138 | with: 139 | repository: ./main 140 | commit_user_name: Azathothas 141 | commit_user_email: AjamX101@gmail.com 142 | #commit_message: " " 143 | commit_message: "✅ Linted (Repo) 🛍️" 144 | #push_options: '--force' 145 | continue-on-error: true -------------------------------------------------------------------------------- /.github/workflows/schedule_builds.yaml: -------------------------------------------------------------------------------- 1 | name: ⏱️ Schedule Matrix Builds 📈 2 | on: 3 | workflow_dispatch: 4 | schedule: 5 | - cron: "30 18 * * Sun,Tue,Fri" # 06:30 PM UTC (12:15 AM NPT Mrng) 6 | #- cron: "30 18 * * 0,2,5" # 06:30 PM UTC (12:15 AM NPT Mrng) 7 | jobs: 8 | pre-trigger-build: 9 | runs-on: ubuntu-latest 10 | permissions: 11 | contents: read 12 | outputs: 13 | build_list: ${{ steps.set-inputs.outputs.build_list }} 14 | steps: 15 | - name: Setup Env 16 | run: | 17 | ##presets 18 | set +x ; set +e 19 | #-------------# 20 | ##CoreUtils 21 | sudo apt update -y 22 | sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y 23 | sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null 24 | #-------------# 25 | ##Host 26 | HOST_TRIPLET="$(uname -m)-$(uname -s)" 27 | echo "HOST_TRIPLET=${HOST_TRIPLET}" >> "${GITHUB_ENV}" 28 | #-------------# 29 | ##Repo 30 | PKG_REPO="${GITHUB_REPOSITORY}" 31 | echo "PKG_REPO=${PKG_REPO#*/}" >> "${GITHUB_ENV}" 32 | #-------------# 33 | ##tmp 34 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 35 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 36 | #-------------# 37 | mkdir -p "${HOME}/bin" 38 | sudo apt update -y 39 | sudo apt install dos2unix -y 40 | ##User-Agent 41 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 42 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 43 | continue-on-error: true 44 | 45 | - name: Get & Set Inputs 46 | id: set-inputs 47 | run: | 48 | ##presets 49 | set +x ; set +e 50 | #-------------# 51 | ##Get Data 52 | mkdir -pv "${SYSTMP}/pkgforge" 53 | curl -w "(Diff) <== %{url}\n" -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/soarpkgs/data/DIFF_${PKG_REPO}_${HOST_TRIPLET}.json" -o "${SYSTMP}/pkgforge/DIFF.json.tmp" 54 | curl -w "(List) <== %{url}\n" "https://raw.githubusercontent.com/pkgforge/${PKG_REPO}/refs/heads/main/SBUILD_LIST.json" -o "${SYSTMP}/pkgforge/SBUILD_LIST.json.tmp" 55 | jq -n --slurpfile a "${SYSTMP}/pkgforge/DIFF.json.tmp" --slurpfile b "${SYSTMP}/pkgforge/SBUILD_LIST.json.tmp" \ 56 | ' 57 | [$b[] | .[] as $objB | 58 | ($a[] | .[] | .build_script | split("/") | .[-3:] | join("/")) as $a_last3 | 59 | ($objB.build_script | split("/") | .[-3:] | join("/")) as $b_last3 | 60 | if $a_last3 == $b_last3 or $objB.rebuild == true then $objB else empty end 61 | ] | unique_by(.ghcr_pkg) | sort_by(.pkg_family) 62 | ' | jq . > "${SYSTMP}/pkgforge/SBUILD_LIST.json" 63 | ##Set Input (100 builds) 64 | BUILD_LIST="$(jq -c '[.[] | select(._disabled == false) | {pkg_family, ghcr_url: .ghcr_pkg, sbuild_url: .build_script, rebuild}] | .[:100]' "${SYSTMP}/pkgforge/SBUILD_LIST.json")" 65 | ##Validate Input 66 | if ! echo "${BUILD_LIST}" | jq -e 'type == "array" and length > 0' >/dev/null; then 67 | echo -e "\n[-] Input Json is likely Invalid\n" 68 | echo "${BUILD_LIST}" | jq . 69 | exit 1 70 | else 71 | ESCAPED_BUILD_LIST=$(echo "$BUILD_LIST" | jq -c .) 72 | echo "build_list=${ESCAPED_BUILD_LIST}" >> "${GITHUB_OUTPUT}" 73 | fi 74 | continue-on-error: false 75 | 76 | - name: Sanity Check Input JSON 77 | run: | 78 | echo '${{ steps.set-inputs.outputs.build_list }}' | jq . 79 | continue-on-error: true 80 | 81 | trigger-build: 82 | needs: [pre-trigger-build] 83 | runs-on: ubuntu-latest 84 | timeout-minutes: 250 85 | permissions: 86 | actions: write 87 | contents: read 88 | statuses: write 89 | strategy: 90 | fail-fast: false 91 | max-parallel: 20 92 | matrix: 93 | package: ${{ fromJSON(needs.pre-trigger-build.outputs.build_list) }} 94 | steps: 95 | - name: Current Package 96 | run: | 97 | echo '${{ toJSON(matrix.package) }}' | jq -r ' 98 | "Package Family: \(.pkg_family)", 99 | "GHCR URL: \(.ghcr_url)", 100 | "Build URL: \(.sbuild_url)", 101 | "Rebuild: \(.rebuild)" 102 | ' 103 | continue-on-error: true 104 | 105 | - name: Trigger Matrix Builds 106 | if: ${{ toJson(matrix.package) != '{}' }} 107 | env: 108 | GH_TOKEN: "${{ github.token }}" 109 | run: | 110 | ##presets 111 | set +x ; set +e 112 | #-------------# 113 | gh workflow run "matrix_builds.yaml" \ 114 | --repo "${GITHUB_REPOSITORY}" \ 115 | --ref "${GITHUB_REF}" \ 116 | -f ci-infra="github" \ 117 | -f host="ALL" \ 118 | -f sbuild-url="${{ matrix.package.sbuild_url }}" \ 119 | -f ghcr-url="${{ matrix.package.ghcr_url }}" \ 120 | -f pkg-family="${{ matrix.package.pkg_family }}" \ 121 | -f debug="false" \ 122 | -f logs="true" \ 123 | -f rebuild="${{ matrix.package.rebuild }}" 124 | continue-on-error: false -------------------------------------------------------------------------------- /.github/workflows/sync_gh_releases.yaml: -------------------------------------------------------------------------------- 1 | name: ♻️↕️ Sync GH Releases ↕️♻️ 2 | concurrency: 3 | group: "${{ github.workflow }}-${{ github.ref }}" 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: "0 */12 * * *" #Every 12 Hrs 10 | jobs: 11 | sync: 12 | runs-on: ${{ matrix.runner }} 13 | timeout-minutes: 30 14 | permissions: 15 | contents: write 16 | packages: write 17 | statuses: read 18 | strategy: 19 | max-parallel: 2 20 | fail-fast: false 21 | matrix: 22 | include: 23 | - runner: "ubuntu-24.04-arm" 24 | repo: "pkgcache" 25 | gh_repo: "https://huggingface.co/datasets/pkgforge/pkgcache" 26 | script: "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/github/sync_releases.sh" 27 | 28 | - runner: "ubuntu-latest" 29 | repo: "pkgcache" 30 | gh_repo: "https://huggingface.co/datasets/pkgforge/pkgcache" 31 | script: "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/github/sync_releases.sh" 32 | 33 | steps: 34 | - name: Install Addons 35 | run: | 36 | #presets 37 | set +x ; set +e 38 | #-------------# 39 | export DEBIAN_FRONTEND="noninteractive" 40 | sudo apt update -y -qq 41 | sudo apt install 7zip b3sum bc coreutils curl dos2unix fdupes jq git git-lfs moreutils wget util-linux -y -qq 42 | sudo apt install 7zip b3sum bc coreutils curl dos2unix fdupes jq git git-lfs moreutils wget util-linux -y -qq 43 | bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 44 | continue-on-error: true 45 | 46 | - name: Setup Env 47 | run: | 48 | #presets 49 | set +x ; set +e 50 | #-------------# 51 | #tmp 52 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 53 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 54 | #-------------# 55 | #Git 56 | sudo apt-get install git-lfs -y -qq 57 | #-------------# 58 | ##User-Agent 59 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 60 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 61 | continue-on-error: true 62 | 63 | - name: Sync Release [${{ matrix.repo }} ==> ${{ matrix.gh_repo }}/releases] 64 | env: 65 | GHCR_TOKEN: "${{ github.token }}" 66 | GITHUB_TOKEN: "${{ github.token }}" 67 | #GITHUB_TOKEN: "${{ secrets.ADM_GHTOKEN }}" 68 | run: | 69 | #Presets 70 | set +x ; set +e 71 | #--------------# 72 | curl -qfsSL "${{ matrix.script }}" -o "./sync.sh" 73 | dos2unix --quiet "./sync.sh" 74 | chmod +x "./sync.sh" 75 | ##To force reupload 76 | #export FORCE_REUPLOAD='YES' 77 | #export PARALLEL_LIMIT="$(($(nproc)+1))" 78 | export PARALLEL_LIMIT="1" 79 | timeout -k 1m 25m bash "./sync.sh" 80 | wait ; echo 81 | continue-on-error: true -------------------------------------------------------------------------------- /.github/workflows/sync_gh_releases_metadata.yaml: -------------------------------------------------------------------------------- 1 | name: ♻️🧬 Sync GH Releases Metadata 🧬♻️ 2 | concurrency: 3 | group: "${{ github.workflow }}-${{ github.ref }}" 4 | cancel-in-progress: true 5 | 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: "50 1-23/2 * * *" #Every 110 mins 10 | jobs: 11 | sync: 12 | runs-on: ${{ matrix.runner }} 13 | timeout-minutes: 10 14 | permissions: 15 | contents: write 16 | packages: write 17 | statuses: read 18 | strategy: 19 | #max-parallel: 2 20 | fail-fast: false 21 | matrix: 22 | include: 23 | - runner: "ubuntu-24.04-arm" 24 | repo: "pkgcache" 25 | gh_repo: "https://huggingface.co/datasets/pkgforge/pkgcache" 26 | script: "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/github/sync_releases_metadata.sh" 27 | 28 | - runner: "ubuntu-latest" 29 | repo: "pkgcache" 30 | gh_repo: "https://huggingface.co/datasets/pkgforge/pkgcache" 31 | script: "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/scripts/github/sync_releases_metadata.sh" 32 | 33 | steps: 34 | - name: Install Addons 35 | run: | 36 | #presets 37 | set +x ; set +e 38 | #-------------# 39 | export DEBIAN_FRONTEND="noninteractive" 40 | sudo apt update -y -qq 41 | sudo apt install 7zip b3sum bc coreutils curl dos2unix fdupes jq git git-lfs moreutils wget util-linux -y -qq 42 | sudo apt install 7zip b3sum bc coreutils curl dos2unix fdupes jq git git-lfs moreutils wget util-linux -y -qq 43 | bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") 44 | continue-on-error: true 45 | 46 | - name: Setup Env 47 | run: | 48 | #presets 49 | set +x ; set +e 50 | #-------------# 51 | #tmp 52 | SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}" 53 | echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}" 54 | #-------------# 55 | #Git 56 | sudo apt-get install git-lfs -y -qq 57 | #-------------# 58 | ##User-Agent 59 | USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" 60 | echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" 61 | continue-on-error: true 62 | 63 | - name: Sync Release [${{ matrix.repo }} ==> ${{ matrix.gh_repo }}/releases/metadata] 64 | env: 65 | GHCR_TOKEN: "${{ github.token }}" 66 | GITHUB_TOKEN: "${{ github.token }}" 67 | #GITHUB_TOKEN: "${{ secrets.ADM_GHTOKEN }}" 68 | run: | 69 | #Presets 70 | set +x ; set +e 71 | #--------------# 72 | curl -qfsSL "${{ matrix.script }}" -o "./sync.sh" 73 | dos2unix --quiet "./sync.sh" 74 | chmod +x "./sync.sh" 75 | bash "./sync.sh" 76 | continue-on-error: true -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Package Forge 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
23 | The Largest Collection of Prebuilt Portable Packages
24 |
25 |
PkgForge (
) Discord
`➼` [`https://discord.gg/djJUs48Zbu`](https://discord.gg/djJUs48Zbu)
59 |
60 | ---
61 | #### Package Stats
62 | > [!NOTE]
63 | > ℹ️ It is usual for most packages to be outdated since we build most of them from `GIT HEAD`