-
Notifications
You must be signed in to change notification settings - Fork 37
72 lines (61 loc) · 2.21 KB
/
go.yml
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
name: Update uBlacklist subscription weekly
on:
schedule:
- cron: "0 0 * * 0"
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
#if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.17.0'
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- name: Merge txt
run: |
cp source/gyli/Blocklist/BLOCKLIST_uBlacklist source/gyli/Blocklist/blocklist.txt
rm uBlacklist.txt
rm uBlocklist.txt
rm tools/uBlacklist_backup.txt
rm source/gyli/Blocklist/blocklist.txt
rm source/Paxxs/Google-Blocklist/data -rf
rm source/laylavish/uBlockOrigin-HUGE-AI-Blocklist/additional_list_nuclear.txt
rm source/laylavish/uBlockOrigin-HUGE-AI-Blocklist/list.txt
rm source/laylavish/uBlockOrigin-HUGE-AI-Blocklist/list_uBlacklist_nuclear.txt
rm source/laylavish/uBlockOrigin-HUGE-AI-Blocklist/noai_hosts.txt
mv reverse_url.txt tools/reverse_url
find . -type f -name "*.txt" -exec cat {} \;> tools/uBlacklist
# Issue # 48
sed -i '/^http:\/\//d' source/zweie/some-rules-for-ublacklist/Annoyingbastard.txt
cd tools
mv uBlacklist uBlacklist.txt
go run main.go
cat -s uBlacklist.txt | sed '/^[[:space:]]*$/d'
mv uBlacklist.txt ../uBlacklist.txt -f
cd ..
sed -i '/^#/d' uBlacklist.txt
sed -i '/^!/d' uBlacklist.txt
cat tools/reverse_url >> uBlacklist.txt
sed -i "1i\! Update weekly at $(TZ=UTC-8 date +'%Y-%m-%d %T %z')" uBlacklist.txt
ln -s uBlacklist.txt uBlocklist.txt
- name: Get Time
run: |
echo "CURRENT_TIME=$(TZ=UTC-8 date +'%Y-%m-%d %T %z')" >> $GITHUB_ENV
- name: Commit files
uses: EndBug/add-and-commit@v9
with:
message: "ci(build): update weekly at ${{ env.CURRENT_TIME }}"
committer_name: 'github-actions[bot]'
committer_email: 'github-actions[bot]@users.noreply.github.com'
add: |
'uBlacklist.txt'
'tools/uBlacklist_backup.txt'