summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorloyalsoldier <[email protected]>2021-07-05 01:14:05 +0800
committerloyalsoldier <[email protected]>2021-07-05 02:08:34 +0800
commita1583ba91878fbb36d854b75fdedbef6fef83641 (patch)
tree7efaf8ad8bb0856a77c90d4d16562d15bf5ff7fa /.github/workflows
parent331ba7814615e0002c7c9a8e91dc94c470362eb3 (diff)
Feat: fetch cidr data from ripe.net & add geoip:netflix
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml24
1 files changed, 20 insertions, 4 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 078e7e88..eddea8d4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,21 +21,37 @@ jobs:
- name: Set variables
run: |
+ echo "PATH=$(go env GOPATH)/bin:${PATH}" >> $GITHUB_ENV
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "RELEASE_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
shell: bash
+ - name: Install cidr-merger
+ run: |
+ go get github.com/zhanhb/cidr-merger
+
- name: Checkout codebase
uses: actions/[email protected]
with:
fetch-depth: 0
- - name: Update appended CIDR lists automatically
+ - name: Fetch lists from ripe.net
+ run: |
+ chmod +x asn.sh
+ ./asn.sh
+
+ - name: Append more CIDRs
run: |
- curl -sSL https://www.cloudflare.com/ips-v4 | grep "/" > data/cloudflare
+ curl -sSL https://www.cloudflare.com/ips-v4 | grep "/" >> data/cloudflare
curl -sSL https://www.cloudflare.com/ips-v6 | grep "/" >> data/cloudflare
- curl -sSL https://api.fastly.com/public-ip-list | jq --raw-output '.addresses[],.ipv6_addresses[]' > data/fastly
- curl -sSL https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips | jq --raw-output '.CLOUDFRONT_GLOBAL_IP_LIST[],.CLOUDFRONT_REGIONAL_EDGE_IP_LIST[]' > data/cloudfront
+ curl -sSL https://api.fastly.com/public-ip-list | jq --raw-output '.addresses[],.ipv6_addresses[]' >> data/fastly
+ curl -sSL https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips | jq --raw-output '.CLOUDFRONT_GLOBAL_IP_LIST[],.CLOUDFRONT_REGIONAL_EDGE_IP_LIST[]' >> data/cloudfront
+
+ - name: Merge CIDR in files except ./data/private
+ run: |
+ for file in $(find ./data -type f ! -name "private"); do
+ cidr-merger --batch -s -o ${file} ${file}
+ done
- name: Commit file changes
run: |