From: gap579137 Date: Sun, 18 May 2025 02:12:34 +0000 (-0500) Subject: automations X-Git-Tag: aggregated-20250518~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c6432643be55cafad80dddb628dc14b3d7706ab;p=thirdparty%2Fblocklistproject%2Flists.git automations --- 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 }}