Skip to content

♻️↕️ Sync GH ↕️♻️ #316

♻️↕️ Sync GH ↕️♻️

♻️↕️ Sync GH ↕️♻️ #316

Workflow file for this run

name: ♻️↕️ Sync GH ↕️♻️
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * *" #UTC 01:00 AM --> 06:45 AM NPT Everyday
#- cron: "0 2 * * Sun" #UTC 02:00 AM --> 07:45 AM NPT Sun
#- cron: "0 2 * * Wed" #UTC 02:00 AM --> 07:45 AM NPT Wed
jobs:
sync:
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
permissions:
contents: write
statuses: read
strategy:
max-parallel: 1
fail-fast: false
matrix:
include:
- runner: "ubuntu-24.04-arm"
pkg-dir: "aarch64-Linux"
repo: "bincache"
script: "https://raw.githubusercontent.com/pkgforge/bin/refs/heads/main/sync.sh"
- runner: "ubuntu-latest"
pkg-dir: "riscv64-Linux"
repo: "bincache"
script: "https://raw.githubusercontent.com/pkgforge/bin/refs/heads/main/sync.sh"
- runner: "ubuntu-latest"
pkg-dir: "x86_64-Linux"
repo: "bincache"
script: "https://raw.githubusercontent.com/pkgforge/bin/refs/heads/main/sync.sh"
- runner: "ubuntu-24.04-arm"
pkg-dir: "aarch64-Linux"
repo: "pkgcache"
script: "https://raw.githubusercontent.com/pkgforge/bin/refs/heads/main/sync.sh"
- runner: "ubuntu-latest"
pkg-dir: "riscv64-Linux"
repo: "pkgcache"
script: "https://raw.githubusercontent.com/pkgforge/bin/refs/heads/main/sync.sh"
- runner: "ubuntu-latest"
pkg-dir: "x86_64-Linux"
repo: "pkgcache"
script: "https://raw.githubusercontent.com/pkgforge/bin/refs/heads/main/sync.sh"
steps:
- name: Install Addons
run: |
#presets
set +x ; set +e
#-------------#
export DEBIAN_FRONTEND="noninteractive"
sudo apt update -y -qq
sudo apt install 7zip b3sum bc coreutils curl dos2unix fdupes jq git git-lfs moreutils wget util-linux -y -qq
sudo apt install 7zip b3sum bc coreutils curl dos2unix fdupes jq git git-lfs moreutils wget util-linux -y -qq
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh")
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/7z" -o "/usr/bin/7z" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/7z" -o "/usr/local/bin/7z" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/aria2" -o "/usr/local/bin/aria2" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/aria2" -o "/usr/local/bin/aria2c" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/b3sum" -o "/usr/bin/b3sum" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/b3sum" -o "/usr/local/bin/b3sum" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/eget" -o "/usr/local/bin/eget" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/jq" -o "/usr/local/bin/jq" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/oras" -o "/usr/local/bin/oras" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/ouch" -o "/usr/local/bin/ouch" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/rclone" -o "/usr/local/bin/rclone" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/rsync" -o "/usr/local/bin/rsync" &
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/yq" -o "/usr/local/bin/yq" &
wait ; echo
sudo chmod -v 'a+x' \
"/usr/bin/7z" \
"/usr/local/bin/7z" \
"/usr/local/bin/aria2c" \
"/usr/bin/b3sum" \
"/usr/local/bin/b3sum" \
"/usr/local/bin/eget" \
"/usr/local/bin/jq" \
"/usr/local/bin/oras" \
"/usr/local/bin/ouch" \
"/usr/local/bin/rclone" \
"/usr/local/bin/rsync" \
"/usr/local/bin/yq"
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}"
#-------------#
##Git
export GH_PAGER=""
echo "GH_PAGER=${GH_PAGER}" >> "${GITHUB_ENV}"
export GIT_TERMINAL_PROMPT="0"
export GIT_USER="Azathothas"
echo "GIT_USER=${GIT_USER}" >> "${GITHUB_ENV}"
export GIT_ASKPASS="/bin/echo"
echo "GIT_ASKPASS=${GIT_ASKPASS}" >> "${GITHUB_ENV}"
gh config set prompt disabled
gh auth login --with-token < <(echo "${{ github.token }}" | tr -d '[:space:]')
git config --global "credential.helper" store
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: Sync Mirror [${{ matrix.repo }} ==> ${{ matrix.pkg-dir }}]
env:
GHCR_TOKEN: "${{ github.token }}"
GITHUB_TOKEN: "${{ github.token }}"
UPSTREAM_REPO: "${{ matrix.repo }}"
run: |
#Presets
set +x ; set +e
#--------------#
curl -qfsSL "${{ matrix.script }}" -o "./sync.sh"
dos2unix --quiet "./sync.sh"
chmod +x "./sync.sh"
if [[ "${{ matrix.pkg-dir }}" == "riscv64-Linux" ]] ; then
export HOST_TRIPLET="riscv64-Linux"
fi
PARALLEL_LIMIT="$(($(nproc)+1))" bash "./sync.sh"
wait ; echo
continue-on-error: true