Skip to content

♻️ Generate External Metadata ♻️ #279

♻️ Generate External Metadata ♻️

♻️ Generate External Metadata ♻️ #279

name: ♻️ Generate External Metadata ♻️
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 */5 * * *" #every 05hrs
jobs:
generate:
runs-on: "${{ matrix.runner }}"
timeout-minutes: 30
permissions:
contents: write
statuses: read
strategy:
max-parallel: 3
fail-fast: false
matrix:
include:
- source: "am"
script: "${GITHUB_WORKSPACE}/main/external/am/scripts/gen_meta.sh"
host: "x86_64-Linux"
runner: "ubuntu-latest"
file: "/tmp/AM.json"
- source: "cargo-bins"
script: "${GITHUB_WORKSPACE}/main/external/cargo-bins/scripts/gen_meta.sh"
host: "aarch64-Linux"
runner: "ubuntu-24.04-arm"
file: "/tmp/cargo-bins.json"
- source: "cargo-bins"
script: "${GITHUB_WORKSPACE}/main/external/cargo-bins/scripts/gen_meta.sh"
host: "x86_64-Linux"
runner: "ubuntu-latest"
file: "/tmp/cargo-bins.json"
- source: "appimagehub"
script: "${GITHUB_WORKSPACE}/main/external/appimagehub/scripts/gen_meta.sh"
host: "aarch64-Linux"
runner: "ubuntu-24.04-arm"
file: "/tmp/appimagehub.json"
- source: "appimagehub"
script: "${GITHUB_WORKSPACE}/main/external/appimagehub/scripts/gen_meta.sh"
host: "x86_64-Linux"
runner: "ubuntu-latest"
file: "/tmp/appimagehub.json"
- source: "appimage.github.io"
script: "${GITHUB_WORKSPACE}/main/external/appimage.github.io/scripts/gen_meta.sh"
host: "aarch64-Linux"
runner: "ubuntu-24.04-arm"
file: "/tmp/appimage.json"
- source: "appimage.github.io"
script: "${GITHUB_WORKSPACE}/main/external/appimage.github.io/scripts/gen_meta.sh"
host: "x86_64-Linux"
runner: "ubuntu-latest"
file: "/tmp/appimage.json"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
fetch-depth: "1"
filter: "blob:none"
- name: Install Addons
run: |
#presets
set +x ; set +e
#-------------#
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh")
continue-on-error: true
- name: Setup Env
run: |
#presets
set +x ; set +e
#-------------#
#tmp
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
#-------------#
#GH Dirs
mkdir -pv "${GITHUB_WORKSPACE}/main/misc/data"
echo "GH_PAGER=" >> "${GITHUB_ENV}"
echo "GIT_TERMINAL_PROMPT=0" >> "${GITHUB_ENV}"
echo "GIT_ASKPASS=/bin/echo" >> "${GITHUB_ENV}"
gh config set prompt disabled
git config --global "user.email" "[email protected]"
git config --global "user.name" "Azathothas"
#-------------#
##User-Agent
USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_firefox_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}"
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}"
continue-on-error: true
- name: Generate Data [${{ matrix.source }}] (${{ matrix.host }})
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
run: |
#Presets
set +x ; set +e
#--------------#
dos2unix --quiet "${{ matrix.script }}"
chmod +x "${{ matrix.script }}"
PARALLEL_LIMIT="$(($(nproc)+1))" bash "${{ matrix.script }}"
continue-on-error: true
- name: Get DateTime & Purge files (=> 95 MB)
run: |
#Presets
set +x ; set +e
#--------------#
UTC_TIME="$(TZ='UTC' date +'%Y-%m-%d (%I:%M:%S %p)')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
#Sync
cd "${GITHUB_WORKSPACE}/main"
git pull origin main --no-edit 2>/dev/null
#Purge
find "${GITHUB_WORKSPACE}/main" -path "${GITHUB_WORKSPACE}/main/.git" -prune -o -type f -size +95M -exec rm -rvf "{}" + 2>/dev/null
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./main
commit_user_name: Azathothas
commit_user_email: [email protected]
commit_message: "βœ… Updated [${{ matrix.source }} (${{ matrix.host }})] πŸ›οΈ"
#push_options: '--force'
continue-on-error: true
- name: Pull & Push (2)
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
git pull origin main --no-edit 2>/dev/null
git pull origin main --ff-only ; git merge --no-ff -m "Merge & Sync"
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./main
commit_user_name: Azathothas
commit_user_email: [email protected]
commit_message: "βœ… Updated [${{ matrix.source }} (${{ matrix.host }})] πŸ›οΈ"
#push_options: '--force'
continue-on-error: true
- name: Upload (LOG) Artifacts [${{ matrix.source }}/${{ matrix.host }})
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.source }}_${{ matrix.host }}
path: |
${{ matrix.file }}
compression-level: 0 # no compression, [Default: 6 (GNU Gzip)]
retention-days: 7
overwrite: true
continue-on-error: true