From f44ea4fbec7cfc6220c1673ff74c318818f6994a Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Tue, 16 Apr 2019 20:24:15 +0800 Subject: [PATCH] update dat files before build --- azure-pipelines.yml | 1 + release/updatedat.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100755 release/updatedat.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 043c36ea..d8ca2488 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -101,6 +101,7 @@ jobs: displayName: 'Install Bazel' - script: | cd ./src/v2ray.com/core + ./release/updatedat.sh $HOME/bin/bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH --action_env=GPG_PASS=${SIGN_KEY_PASS} --action_env=SPWD=$PWD --action_env=GOCACHE=$(go env GOCACHE) --spawn_strategy local //release:all workingDirectory: '$(GOPATH)' displayName: 'Build Binaries' diff --git a/release/updatedat.sh b/release/updatedat.sh new file mode 100755 index 00000000..17639305 --- /dev/null +++ b/release/updatedat.sh @@ -0,0 +1,14 @@ +#!/bin/bash + + +pushd $GOPATH/src/v2ray.com/core/ +# Update geoip.dat +GEOIP_TAG=$(curl --silent "https://api.github.com/repos/v2ray/geoip/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +curl -L -o release/config/geoip.dat "https://github.com/v2ray/geoip/releases/download/${GEOIP_TAG}/geoip.dat" +sleep 1 + +# Update geosite.dat +GEOSITE_TAG=$(curl --silent "https://api.github.com/repos/v2ray/domain-list-community/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +curl -L -o release/config/geosite.dat "https://github.com/v2ray/domain-list-community/releases/download/${GEOSITE_TAG}/dlc.dat" +sleep 1 +popd