diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5a6338c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: release +on: + schedule: + - cron: "0 0 * * 3" + +env: + ACTION_FILENAME: release.yml + TARGET: v2fly/geoip + REQUIRED_FILES: | + cn.dat + geoip.dat + geoip-only-cn-private.dat + private.dat +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check and release + run: | + TARGET_TAG_URL="https://api.github.com/repos/$TARGET/releases/latest" + TARGET_LATEST_VER=`curl -s ${TARGET_TAG_URL} --connect-timeout 30| grep 'tag_name' | cut -d\" -f4` + TARGET_DIST_URLs=`curl -s ${TARGET_TAG_URL} --connect-timeout 30| grep 'browser_download_url' | cut -d\" -f4` + DIST_TAGS_URL="https://api.github.com/repos/${{ github.repository }}/tags" + DIST_TAG_FOUND=`curl -s ${DIST_TAGS_URL} --connect-timeout 30| grep "\"name\"\: \"${TARGET_LATEST_VER}\""` || true + if [ -z ${DIST_TAG_FOUND} ]; then + echo $TARGET_DIST_URLs|while read -r line;do wget $line &> /dev/null;done + echo $REQUIRED_FILES|while read -r line;do ls $line;done + mkdir -p .github/workflows + wget -O .github/workflows/release.yml https://github.com/${{ github.repository }}/raw/master/.github/workflows/$ACTION_FILENAME + git init + git add . + git config --local user.name "${{ github.actor }}" + git config --local user.email "${{ github.actor }}@users.noreply.github.com" + git commit -m "Version ${TARGET_LATEST_VER}" + git tag -a "${TARGET_LATEST_VER}" -m "Version ${TARGET_LATEST_VER}" + git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" + git push -u --force --follow-tags origin master + fi + diff --git a/cn.dat b/cn.dat new file mode 100644 index 0000000..b1bd420 Binary files /dev/null and b/cn.dat differ diff --git a/cn.dat.sha256sum b/cn.dat.sha256sum new file mode 100644 index 0000000..556297a --- /dev/null +++ b/cn.dat.sha256sum @@ -0,0 +1 @@ +5332e75185fc743de62d3fe8bd47df337fcb2aaac772126426c43f3bd6eae91c cn.dat diff --git a/geoip-only-cn-private.dat b/geoip-only-cn-private.dat new file mode 100644 index 0000000..b87e9c2 Binary files /dev/null and b/geoip-only-cn-private.dat differ diff --git a/geoip-only-cn-private.dat.sha256sum b/geoip-only-cn-private.dat.sha256sum new file mode 100644 index 0000000..3f0a7f9 --- /dev/null +++ b/geoip-only-cn-private.dat.sha256sum @@ -0,0 +1 @@ +42e4663dea277d85fbd880a7b3164f10088d9b57c44eaf9dd90bfb4e500e4c6a geoip-only-cn-private.dat diff --git a/geoip.dat b/geoip.dat new file mode 100644 index 0000000..dc2cc45 Binary files /dev/null and b/geoip.dat differ diff --git a/geoip.dat.sha256sum b/geoip.dat.sha256sum new file mode 100644 index 0000000..ac93d41 --- /dev/null +++ b/geoip.dat.sha256sum @@ -0,0 +1 @@ +f83e89edfd3b35acbbbb862a4c88a8ca3e1ddce4d298cc617be79bdaa23a0672 geoip.dat diff --git a/private.dat b/private.dat new file mode 100644 index 0000000..ba04bce Binary files /dev/null and b/private.dat differ diff --git a/private.dat.sha256sum b/private.dat.sha256sum new file mode 100644 index 0000000..7000478 --- /dev/null +++ b/private.dat.sha256sum @@ -0,0 +1 @@ +ac5f6df7cf67c2f19e42f7bacdecdff7660671eab164af91633399517af00b73 private.dat