-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathmain.yml.iblocklist
117 lines (97 loc) · 3.66 KB
/
main.yml.iblocklist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
schedule:
- cron: "0 0 * * *"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: initialize
run: |
git config user.name github-actions
git config user.email [email protected]
- name: check repo size
run: |
du -h
- name: remove binary files from history (reduce the repo size)
run: |
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch bt_blocklists.gz" --prune-empty --tag-name-filter cat -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget curl grep gzip findutils git
- name: download from iblocklist
run: |
curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*\)'.*/\1/p" \
| sed "s/\&/\&/g" \
| sed "s/http/\"http/g" \
| sed "s/gz/gz\"/g" \
| xargs curl -s -L \
| gunzip \
| egrep -v '^#' \
| sed "/^$/d" > bt_blocklists
# Their ssl cert expired at march 1st 2022 (they renewed
- name: download from mirror.codebucket.de
run: |
curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://mirror.codebucket.de/transmission/blocklist.p2p >> bt_blocklists
# The author moved to github, format changed
#- name: download from www.wael.name
# run: |
# curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://raw.githubusercontent.com/waelisa/Best-blocklist/main/wael.list.txt | sed "/^#.*/d" | grep -Ev "^[0-9][0-9][0-9]\.[0-9][0-9][0-9].*" >> bt_blocklists
- name: remove duplicates
run: |
sort --unique bt_blocklists > bt_blocklists_deduplicated
mv bt_blocklists_deduplicated bt_blocklists
- name: combine all files
run: |
gzip -c bt_blocklists > bt_blocklists.gz
- name: check the file size
run: |
check=`du -s bt_blocklists.gz | awk '{print $1}'`
if [ "$check" -lt 1000 ]
then
exit 2
fi
- name: Push
run: |
git add .
git commit -m "auto update"
git push origin --force --all
du -sh .git
- name: check repo size
run: |
du -h
- name: Delete the old release
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: master
repo: Naunter/BT_BlockLists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push the new release
uses: softprops/action-gh-release@v1
with:
name: bt_blocklists
tag_name: v.1
files: bt_blocklists.gz
- name: check repo size
run: |
du -h