Build Third-party filters #2353
This file contains hidden or 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: Build Third-party filters | |
| on: | |
| # For manual run builds | |
| workflow_dispatch: | |
| schedule: | |
| # Run every 4 hours at minute 30 (to avoid overlap with build-adguard) | |
| # This runs at 00:30, 04:30, 08:30, 12:30, 16:30, 20:30 | |
| - cron: '30 */4 * * *' | |
| pull_request: | |
| paths-ignore: | |
| # Do not trigger build on changes to the following files. | |
| # It is needed to avoid pull request merge blocking | |
| # as compiler does not use the updated config during the build. | |
| - "optimization_config.json" | |
| env: | |
| BUILD_MODE: 3p | |
| jobs: | |
| build: | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo with depth 1 | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Lint | |
| run: yarn lint | |
| - name: Build filters | |
| run: yarn auto-build --mode ${{ env.BUILD_MODE }} | |
| - name: Commit & Push changes | |
| uses: actions-js/push@v1.5 | |
| if: github.ref == 'refs/heads/master' && github.repository == 'AdguardTeam/FiltersRegistry' && github.event_name != 'pull_request' | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: "master" | |
| message: "skip ci: auto-build ${{ env.BUILD_MODE }} filters" | |
| notify: | |
| name: Send Slack notification on failure | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # Run even if the build job failed, but only for our own repo | |
| if: | |
| ${{ | |
| always() && | |
| needs.build.result == 'failure' && | |
| github.repository == 'AdguardTeam/FiltersRegistry' && | |
| ( | |
| github.event_name == 'push' || | |
| github.event_name == 'schedule' || | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| ) | |
| ) | |
| }} | |
| steps: | |
| - uses: 8398a7/action-slack@v3 | |
| with: | |
| status: failure | |
| fields: workflow,repo,message,commit,author,eventName,ref,job | |
| job_name: Build Third-party filters | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |