-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11d3021
commit 98eb34c
Showing
1 changed file
with
224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
name: ♻️ Generate ThirdParty Metadata ♻️ | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 3 * * *" #UTC 03:00 AM --> 08:45 AM NPT @everyday | ||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 200 | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
path: main | ||
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" | ||
#Setup Flatpak | ||
sudo apt update -y -qq | ||
sudo apt install flatpak -y | ||
sudo usermod -aG "_flatpak" "runner" | ||
#-------------# | ||
##User-Agent | ||
USER_AGENT="$(curl -qfsSL 'https://pub.ajam.dev/repos/Azathothas/Wordlists/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" | ||
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" | ||
continue-on-error: true | ||
|
||
- name: Generate Alpine & Brew | ||
run: | | ||
#Presets | ||
set +x ; set +e | ||
#--------------# | ||
#Generate Alpine Data (Git) | ||
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_alpine_git.sh") | ||
dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_alpine_git.sh" | ||
chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_alpine_git.sh" | ||
bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_alpine_git.sh" & | ||
#Generate Alpine Data (Pkg) | ||
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_alpine_pkg.sh") | ||
dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_alpine_pkg.sh" | ||
chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_alpine_pkg.sh" | ||
bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_alpine_pkg.sh" & | ||
#Generate HomeBrew Data | ||
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_homebrew.sh") | ||
dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_homebrew.sh" | ||
chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_homebrew.sh" | ||
bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_homebrew.sh" & | ||
wait ; echo | ||
continue-on-error: true | ||
|
||
- name: Generate ArchLinux | ||
run: | | ||
#Presets | ||
set +x ; set +e | ||
#--------------# | ||
#Docker | ||
pushd "$(mktemp -d)" >/dev/null 2>&1 | ||
chmod +xwr "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_archlinux.sh" | ||
docker run --privileged --name "archlinux" -u "runner" -v "${GITHUB_WORKSPACE}:/workspace" "azathothas/archlinux-builder:latest" bash -l -c '"/workspace/main/scripts/metadata/fetch_archlinux.sh"' | ||
docker cp "archlinux:/tmp/ARCHLINUX.json" "$(pwd)/ARCHLINUX.json" | ||
cp -fv "./ARCHLINUX.json" "${SYSTMP}/ARCHLINUX.json" | ||
popd >/dev/null 2>&1 | ||
continue-on-error: true | ||
|
||
- name: Generate Debian | ||
run: | | ||
#Presets | ||
set +x ; set +e | ||
#--------------# | ||
#Generate Debian Data | ||
##bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_debian.sh") | ||
#dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_debian.sh" | ||
#chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_debian.sh" | ||
#bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_debian.sh" | ||
#Docker | ||
pushd "$(mktemp -d)" >/dev/null 2>&1 | ||
chmod +xwr "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_debian.sh" | ||
docker run --privileged --name "debian" -v "${GITHUB_WORKSPACE}:/workspace" "debian:latest" bash -l -c '"/workspace/main/scripts/metadata/fetch_debian.sh"' | ||
docker cp "debian:/tmp/DEBIAN.json" "$(pwd)/DEBIAN.json" | ||
cp -fv "./DEBIAN.json" "${SYSTMP}/DEBIAN.json" | ||
popd >/dev/null 2>&1 | ||
continue-on-error: true | ||
|
||
- name: Generate FlatPak & NixPkgs & PkgSrc | ||
run: | | ||
#Presets | ||
set +x ; set +e | ||
#--------------# | ||
#Generate Flatpak Data | ||
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_flatpak.sh") | ||
dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_flatpak.sh" | ||
chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_flatpak.sh" | ||
bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_flatpak.sh" & | ||
#Generate NixPkgs Data | ||
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_nixpkgs.sh") | ||
dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_nixpkgs.sh" | ||
chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_nixpkgs.sh" | ||
bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_nixpkgs.sh" & | ||
#Generate PkgSrc Data | ||
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/scripts/fetch_pkgsrc.sh") | ||
dos2unix --quiet "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_pkgsrc.sh" | ||
chmod +x "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_pkgsrc.sh" | ||
bash "${GITHUB_WORKSPACE}/main/misc/scripts/fetch_pkgsrc.sh" & | ||
wait ; echo | ||
continue-on-error: true | ||
|
||
- name: Copy (Repo) | ||
run: | | ||
#Presets | ||
set +x ; set +e | ||
#--------------# | ||
if [[ -s "${SYSTMP}/ALPINE_GIT.json" ]] && [[ $(stat -c%s "${SYSTMP}/ALPINE_GIT.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/ALPINE_GIT.json" "${GITHUB_WORKSPACE}/main/misc/data/ALPINE_GIT.json" | ||
fi | ||
if [[ -s "${SYSTMP}/ALPINE_PKG.json" ]] && [[ $(stat -c%s "${SYSTMP}/ALPINE_PKG.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/ALPINE_PKG.json" "${GITHUB_WORKSPACE}/main/misc/data/ALPINE_PKG.json" | ||
fi | ||
if [[ -s "${SYSTMP}/ARCHLINUX.json" ]] && [[ $(stat -c%s "${SYSTMP}/ARCHLINUX.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/ARCHLINUX.json" "${GITHUB_WORKSPACE}/main/misc/data/ARCHLINUX.json" | ||
fi | ||
if [[ -s "${SYSTMP}/BREW_FORMULA.json" ]] && [[ $(stat -c%s "${SYSTMP}/BREW_FORMULA.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/BREW_FORMULA.json" "${GITHUB_WORKSPACE}/main/misc/data/BREW_FORMULA.json" | ||
fi | ||
if [[ -s "${SYSTMP}/BREW_CASK.json" ]] && [[ $(stat -c%s "${SYSTMP}/BREW_CASK.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/BREW_CASK.json" "${GITHUB_WORKSPACE}/main/misc/data/BREW_CASK.json" | ||
fi | ||
if [[ -s "${SYSTMP}/DEBIAN.json" ]] && [[ $(stat -c%s "${SYSTMP}/DEBIAN.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/DEBIAN.json" "${GITHUB_WORKSPACE}/main/misc/data/DEBIAN.json" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_APPSTREAM.xml" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_APPSTREAM.xml") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_APPSTREAM.xml" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPSTREAM.xml" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_APPS_INFO.txt" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_APPS_INFO.txt") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_APPS_INFO.txt" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPS_INFO.txt" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_APPS_INFO.txt" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_APPS_INFO.txt") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_APPS_INFO.txt" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPS_INFO.txt" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_APPS_INFO.json" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_APPS_INFO.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_APPS_INFO.json" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPS_INFO.json" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_APP_IDS.txt" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_APP_IDS.txt") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_APP_IDS.txt" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APP_IDS.txt" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_POPULAR.json" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_POPULAR.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_POPULAR.json" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_POPULAR.json" | ||
fi | ||
if [[ -s "${SYSTMP}/FLATPAK_TRENDING.json" ]] && [[ $(stat -c%s "${SYSTMP}/FLATPAK_TRENDING.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/FLATPAK_TRENDING.json" "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_TRENDING.json" | ||
fi | ||
if [[ -s "${SYSTMP}/NIXPKGS.json" ]] && [[ $(stat -c%s "${SYSTMP}/NIXPKGS.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/NIXPKGS.json" "${GITHUB_WORKSPACE}/main/misc/data/NIXPKGS.json" | ||
fi | ||
if [[ -s "${SYSTMP}/PKGSRC.json" ]] && [[ $(stat -c%s "${SYSTMP}/PKGSRC.json") -gt 1000 ]]; then | ||
cp -fv "${SYSTMP}/PKGSRC.json" "${GITHUB_WORKSPACE}/main/misc/data/PKGSRC.json" | ||
fi | ||
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 (ThirdParty Metadata) 🛍️" | ||
#push_options: '--force' | ||
continue-on-error: true | ||
|
||
- name: Upload (R2) | ||
run: | | ||
# Presets | ||
set +x ; set +e | ||
#--------------# | ||
#touch "${HOME}/.rclone.conf" | ||
echo "${{ secrets.CF_META }}" > "${HOME}/.rclone.conf" | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/ALPINE_GIT.json" "r2:/meta/misc/ALPINE_GIT.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/ALPINE_PKG.json" "r2:/meta/misc/ALPINE_PKG.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/ARCHLINUX.json" "r2:/meta/misc/ARCHLINUX.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/BREW_FORMULA.json" "r2:/meta/misc/BREW_FORMULA.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/BREW_CASK.json" "r2:/meta/misc/BREW_CASK.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/DEBIAN.json" "r2:/meta/misc/DEBIAN.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPSTREAM.xml" "r2:/meta/misc/FLATPAK_APPSTREAM.xml" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPS_INFO.txt" "r2:/meta/misc/FLATPAK_APPS_INFO.txt" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPS_INFO.txt" "r2:/meta/misc/FLATPAK_APPS_INFO.txt" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APPS_INFO.json" "r2:/meta/misc/FLATPAK_APPS_INFO.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_APP_IDS.txt" "r2:/meta/misc/FLATPAK_APP_IDS.txt" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_POPULAR.json" "r2:/meta/misc/FLATPAK_POPULAR.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/FLATPAK_TRENDING.json" "r2:/meta/misc/FLATPAK_TRENDING.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/NIXPKGS.json" "r2:/meta/misc/NIXPKGS.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
rclone copyto "${GITHUB_WORKSPACE}/main/misc/data/PKGSRC.json" "r2:/meta/misc/PKGSRC.json" --checksum --check-first --user-agent="${USER_AGENT}" & | ||
continue-on-error: true |