-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bf9ea8
commit 59cbe3a
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ jobs: | |
echo "RELEASE_NAME=Released on $(date +%Y%m%d%H%M)" >> $GITHUB_ENV | ||
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV | ||
echo "heidai_dns=https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockdns.txt" >> $GITHUB_ENV | ||
echo "AdGuardSDNSFilter=https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Checkout the default branch | ||
|
@@ -31,17 +32,28 @@ jobs: | |
- name: Make directory | ||
run: | | ||
mkdir -p 217heidai | ||
mkdir -p AdGuard | ||
- name: Generate adblockdns.txt & adblockdns-whitelist.txt file | ||
- name: Generate 217heidai file | ||
run: | | ||
curl -sSL ${heidai_dns} | grep -Ev "^(#|!|@@)" | grep -v "^[[:space:]]*$" | sed -e 's/^||//; s/\^$//' > 217heidai/adblockdns.txt | ||
curl -sSL ${heidai_dns} | grep -Ev "^(#|!|\|\|)" | grep -v "^[[:space:]]*$" | sed -e 's/^@@||//; s/\^$//' > 217heidai/adblockdns-whitelist.txt | ||
- name: Generate AdGuard file | ||
run: | | ||
curl -sSL ${AdGuardSDNSFilter} | grep -Ev "^(#|!|@@)" | grep -v "^[[:space:]]*$" | sed -e 's/^||//; s/\^$//' > AdGuard/dnsfilter.txt | ||
curl -sSL ${AdGuardSDNSFilter} | grep -Ev "^(#|!|\|\|)" | grep -v "^[[:space:]]*$" | sed -e 's/^@@||//; s/\^$//' > AdGuard/dnsfilter-whitelist.txt | ||
- name: Zip 217heidai | ||
uses: montudor/action-zip@v1 | ||
with: | ||
args: zip -qq -r 217heidai.zip 217heidai | ||
|
||
- name: Zip AdGuard | ||
uses: montudor/action-zip@v1 | ||
with: | ||
args: zip -qq -r AdGuard.zip AdGuard | ||
|
||
- name: Upload files to GitHub release | ||
uses: softprops/[email protected] | ||
with: | ||
|
@@ -54,7 +66,9 @@ jobs: | |
- name: Move files to publish directory | ||
run: | | ||
mkdir -p publish/217heidai | ||
mkdir -p publish/AdGuard | ||
mv 217heidai/* ./publish/217heidai/ | ||
mv AdGuard/* ./publish/AdGuard/ | ||
- name: Git push assets to "release" branch | ||
run: | | ||
|
@@ -74,3 +88,6 @@ jobs: | |
for file in $(ls 217heidai); do | ||
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/217heidai/${file}" | ||
done | ||
for file in $(ls AdGuard); do | ||
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/AdGuard/${file}" | ||
done |