Skip to content

Fetch Latest Repo Info #51

Fetch Latest Repo Info

Fetch Latest Repo Info #51

name: Fetch Latest Repo Info
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
jobs:
update-info:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y jq curl coreutils
- name: Fetch latest releases and anticheat file hashes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "{}" > release-data.json
# -------------------------------
# Release repositories (mapped keys)
# -------------------------------
declare -A release_repos=(
["ge-proton"]="GloriousEggroll/proton-ge-custom"
["wine-ge"]="GloriousEggroll/wine-ge-custom"
["game-porting-toolkit"]="Gcenx/game-porting-toolkit"
["wine-crossover"]="Gcenx/winecx"
["wine-staging"]="Gcenx/macOS_Wine_builds"
["dxmt"]="3Shain/dxmt"
["dxvk"]="doitsujin/dxvk"
["vkd3d"]="HansKristian-Work/vkd3d-proton"
["dxvk-mac"]="Gcenx/DXVK-macOS"
)
for key in "${!release_repos[@]}"; do
repo="${release_repos[$key]}"
echo "Fetching release for $repo as $key"
api="https://api.github.com/repos/$repo/releases/latest"
response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$api")
tag=$(echo "$response" | jq -r '.tag_name')
date=$(echo "$response" | jq -r '.published_at')
jq --arg k "$key" --arg t "$tag" --arg d "$date" \
'. + {($k): {tag: $t, published_at: $d}}' \
release-data.json > tmp.json && mv tmp.json release-data.json
done
# -------------------------------
# games.json MD5 (Linux / macOS)
# -------------------------------
linux_repo="AreWeAntiCheatYet/AreWeAntiCheatYet"
mac_repo="Heroic-Games-Launcher/MacAnticheatData"
linux_tmp=$(mktemp)
mac_tmp=$(mktemp)
curl -sL "https://raw.githubusercontent.com/$linux_repo/master/games.json" -o "$linux_tmp"
curl -sL "https://raw.githubusercontent.com/$mac_repo/master/games.json" -o "$mac_tmp"
shaLinux=$(md5sum "$linux_tmp" | awk '{print $1}')
shaMac=$(md5sum "$mac_tmp" | awk '{print $1}')
jq --arg l "$shaLinux" --arg m "$shaMac" \
'. + {anticheatFiles: {shaMac: $m, shaLinux: $l}}' \
release-data.json > tmp.json && mv tmp.json release-data.json
rm "$linux_tmp" "$mac_tmp"
cat release-data.json
- name: Commit JSON
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update releases and anticheat file hashes"
file_pattern: "release-data.json"