Release Update #734
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
name: Release Update | |
on: | |
schedule: | |
- cron: '0 * * * *' # Check Every Hour | |
workflow_dispatch: | |
jobs: | |
update-blocklist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.BOT_GITHUB_TOKEN || github.token }} | |
- name: Download files & setup WireGuard | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wireguard resolvconf | |
echo "${{ secrets.WIREGUARD_CONFIG }}" > wg0.conf | |
sudo mv wg0.conf /etc/wireguard/wg0.conf | |
sudo wg-quick up wg0 | |
curl --insecure -m 300 -o "domains.txt" "${{ secrets.SOURCE_URL }}" | |
curl --insecure -m 300 -o "ipaddress_isp.txt" "${{ secrets.SOURCE_URL2 }}" | |
curl --insecure -m 300 -o "situs_judi.txt" "${{ secrets.SITUS_JUDI }}" | |
shell: bash | |
continue-on-error: false | |
- name: kill WireGuard | |
run: | | |
sudo wg-quick down wg0 | |
shell: bash | |
- name: Install GitHub CLI & authenticate | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gh | |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token | |
- name: Delete existing release & create new one | |
run: | | |
TAG="latest" | |
if gh release view "$TAG" &>/dev/null; then | |
echo "Release $TAG exists. Deleting it first." | |
gh release delete "$TAG" -y | |
else | |
echo "No existing release with tag $TAG found." | |
fi | |
gh release create "$TAG" \ | |
--title "Latest Blocklist Update" \ | |
--notes "This release contains the latest blocklist updates: | |
* domains.txt: $( | |
wc -l < domains.txt | |
) domains | |
* ipaddress_isp.txt: $( | |
wc -l < ipaddress_isp.txt | |
) IP addresses | |
* situs_judi.txt: $( | |
wc -l < situs_judi.txt | |
) domains" \ | |
domains.txt ipaddress_isp.txt situs_judi.txt | |
- name: Cleanup | |
run: | | |
rm -f domains.txt ipaddress_isp.txt situs_judi.txt | |
shell: bash |