Maybe fix (and update) GeoIP db inclusion
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user