From 8c6432643be55cafad80dddb628dc14b3d7706ab Mon Sep 17 00:00:00 2001 From: gap579137 Date: Sat, 17 May 2025 21:12:34 -0500 Subject: [PATCH] automations --- .../workflows/.github/workflows/aggregate.yml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/.github/workflows/aggregate.yml diff --git a/.github/workflows/.github/workflows/aggregate.yml b/.github/workflows/.github/workflows/aggregate.yml new file mode 100644 index 00000000..f58eab16 --- /dev/null +++ b/.github/workflows/.github/workflows/aggregate.yml @@ -0,0 +1,56 @@ +name: Build & Release Aggregated Blocklists + +on: + schedule: + - cron: '0 0 * * *' # every night at midnight UTC + workflow_dispatch: # manual trigger + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Generate aggregated lists + run: python3 scripts/aggregate.py + + - name: Commit outputs + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add releases/ + # only commit if there are changes + git diff --quiet || git commit -m "chore: update aggregated lists" + git push + + release: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: aggregated-$(date +'%Y%m%d') + release_name: Aggregated Lists $(date +'%Y-%m-%d') + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload release assets + uses: softprops/action-gh-release@v1 + with: + files: | + releases/aggregated-hosts.txt + releases/aggregated-dnsmasq.conf + releases/aggregated-adblock.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- 2.47.3