From 1df5897c1a5f2e7eb3384ceef51e9247c6ae2287 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Mon, 25 May 2026 11:09:21 -0400 Subject: [PATCH] Maybe fix (and update) GeoIP db inclusion --- .github/workflows/build-release.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index a48ffff8..e8e875bd 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -106,6 +106,8 @@ jobs: - name: Install dependencies shell: bash + env: + MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }} run: | mkdir -p '${{ steps.path_helper.outputs.dependencies }}' cd '${{ steps.path_helper.outputs.dependencies }}' @@ -114,13 +116,23 @@ jobs: mkdir -p sourcemod ../sourcemod/tools/checkout-deps.sh -s ${{ join(fromJson(steps.sdk_list.outputs.sdk_list), ',') }} - if [ ! -f GeoLite2-City_20191217/GeoLite2-City.mmdb ]; then - geotar="GeoLite2-City_20191217.tar.gz" - curl -sSL "https://sm.alliedmods.net/$geotar" -o $geotar - tar -xzf "$geotar" - rm "$geotar" + if [ -z "$MAXMIND_LICENSE_KEY" ]; then + echo "::error::MAXMIND_LICENSE_KEY secret is not configured." + exit 1 fi + geotmpdir=$(mktemp -d) + geotar="$geotmpdir/GeoLite2-City.tar.gz" + curl -fsSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -o "$geotar" + tar -xzf "$geotar" -C "$geotmpdir" + geommdb=$(find "$geotmpdir" -type f -name 'GeoLite2-City.mmdb' | head -n 1) + if [ -z "$geommdb" ]; then + echo "::error::GeoLite2-City.mmdb not found in downloaded MaxMind archive." + exit 1 + fi + cp "$geommdb" '${{ steps.path_helper.outputs.dependencies }}/GeoLite2-City.mmdb' + rm -rf "$geotmpdir" + - name: Build working-directory: sourcemod shell: bash @@ -143,7 +155,7 @@ jobs: ambuild mkdir -p addons/sourcemod/configs/geoip - cp '${{ steps.path_helper.outputs.dependencies }}/GeoLite2-City_20191217/GeoLite2-City.mmdb' addons/sourcemod/configs/geoip/GeoLite2-City.mmdb + cp '${{ steps.path_helper.outputs.dependencies }}/GeoLite2-City.mmdb' addons/sourcemod/configs/geoip/GeoLite2-City.mmdb - name: Package id: package