From 11ec77bc768a07a727d5f5836aa9fe4c8e20421c Mon Sep 17 00:00:00 2001 From: Senis John Date: Fri, 30 Dec 2022 12:27:01 +0800 Subject: [PATCH] update: release.yml Replace old download URL --- .github/workflows/release.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07856a60..56a58f33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -169,16 +169,17 @@ jobs: command: | cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE - - wget -O ./build_assets/geoip.dat "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat" - echo -e "Verifying HASH key..." - HASH="$(curl -sL "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat.sha256sum" | awk -F ' ' '{print $1}')" - [ "$(sha256sum "./build_assets/geoip.dat" | awk -F ' ' '{print $1}')" == "${HASH}" ] || { echo -e "The HASH key of geoip.dat does not match cloud one."; exit 1; } - - wget -O ./build_assets/geosite.dat "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat" - echo -e "Verifying HASH key..." - HASH="$(curl -sL "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat.sha256sum" | awk -F ' ' '{print $1}')" - [ "$(sha256sum "./build_assets/geosite.dat" | awk -F ' ' '{print $1}')" == "${HASH}" ] || { echo -e "The HASH key of geosite.dat does not match cloud one."; exit 1; } + LIST=('geoip geoip geoip' 'domain-list-community dlc geosite') + for i in "${LIST[@]}" + do + INFO=($(echo $i | awk 'BEGIN{FS=" ";OFS=" "} {print $1,$2,$3}')) + FILE_NAME="${INFO[2]}.dat" + echo -e "Downloading https://raw.githubusercontent.com/v2fly/${INFO[0]}/release/${INFO[1]}.dat..." + curl -L "https://raw.githubusercontent.com/v2fly/${INFO[0]}/release/${INFO[1]}.dat" -o ./build_assets/${FILE_NAME} + echo -e "Verifying HASH key..." + HASH="$(curl -sL "https://raw.githubusercontent.com/v2fly/${INFO[0]}/release/${INFO[1]}.dat.sha256sum" | awk -F ' ' '{print $1}')" + [ "$(sha256sum "./build_assets/${FILE_NAME}" | awk -F ' ' '{print $1}')" == "${HASH}" ] || { echo -e "The HASH key of ${FILE_NAME} does not match cloud one."; exit 1; } + done - name: Create ZIP archive shell: bash