summaryrefslogtreecommitdiffstats
path: root/uAssets/.github/workflows
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:47:55 +0000
commit31d6ff6f931696850c348007241195ab3b2eddc7 (patch)
tree615cb1c57ce9f6611bad93326b9105098f379609 /uAssets/.github/workflows
parentInitial commit. (diff)
downloadublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.tar.xz
ublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.zip
Adding upstream version 1.55.0+dfsg.upstream/1.55.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'uAssets/.github/workflows')
-rw-r--r--uAssets/.github/workflows/main.yml58
-rw-r--r--uAssets/.github/workflows/on-youtube-issue.yml32
-rw-r--r--uAssets/.github/workflows/update-3rd-party-assets.yml32
-rw-r--r--uAssets/.github/workflows/update-easylist.yml32
4 files changed, 154 insertions, 0 deletions
diff --git a/uAssets/.github/workflows/main.yml b/uAssets/.github/workflows/main.yml
new file mode 100644
index 0000000..66d82d4
--- /dev/null
+++ b/uAssets/.github/workflows/main.yml
@@ -0,0 +1,58 @@
+name: Deploy to gh-pages branch
+
+on:
+ push:
+ branches:
+ - master
+
+# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ permissions:
+ contents: write # for Git to git push
+ name: Publish lists
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone uAssets
+ uses: actions/checkout@v3
+ with:
+ ref: gh-pages
+ - name: Copy filter lists to gh-pages
+ run: |
+ TMPDIR=$(mktemp -d)
+ git clone --depth=1 https://github.com/uBlockOrigin/uAssets.git $TMPDIR
+ pushd $TMPDIR > /dev/null
+ ./tools/make-ublock.sh
+ popd > /dev/null
+ cp $TMPDIR/filters/*.txt filters/
+ cp $TMPDIR/thirdparties/easylist/easy*.txt thirdparties/
+ cp $TMPDIR/dnr/*.json dnr/
+ - name: Patch last-updated field
+ run: |
+ DATE=$(date -Ru)
+ for f in $(git diff --name-only); do
+ STAT=$(git diff --numstat $f | sed -r '/^1\s+1\s+/d')
+ if [[ -n $STAT ]]; then
+ sed -ir "0,/^! Last modified: /s/^\(! Last modified: \)%timestamp%/\\1$DATE/" $f
+ else
+ git checkout -q $f
+ fi
+ done
+ - name: Commit changes (if any)
+ run: |
+ if [[ -n $(git diff) ]]; then
+ git config user.name "gitHub-actions bot"
+ git config user.email "<>"
+ git add -u filters/
+ git add -u thirdparties/
+ git add -u dnr/
+ git commit -m "Update modified filter lists"
+ git push origin gh-pages
+ fi
diff --git a/uAssets/.github/workflows/on-youtube-issue.yml b/uAssets/.github/workflows/on-youtube-issue.yml
new file mode 100644
index 0000000..d9b1d7d
--- /dev/null
+++ b/uAssets/.github/workflows/on-youtube-issue.yml
@@ -0,0 +1,32 @@
+name: Triage Youtube issues
+
+on:
+ issues:
+ types: opened
+
+jobs:
+ check-if-youtube:
+ name: Close as duplicate
+ runs-on: ubuntu-latest
+ if: startsWith(github.event.issue.title, 'youtube.com:')
+ permissions:
+ issues: write
+ steps:
+ - name: Add label
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'add-labels'
+ labels: 'duplicate'
+ - name: Add comment
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'create-comment'
+ body: |
+ Please respect what is asked in the issue template to not unduly burden volunteers.
+
+ This is a `youtube.com` issue, see <https://github.com/uBlockOrigin/uAssets/issues/20586>.
+ - name: Close issue
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'close-issue'
+ close-reason: not_planned
diff --git a/uAssets/.github/workflows/update-3rd-party-assets.yml b/uAssets/.github/workflows/update-3rd-party-assets.yml
new file mode 100644
index 0000000..7065811
--- /dev/null
+++ b/uAssets/.github/workflows/update-3rd-party-assets.yml
@@ -0,0 +1,32 @@
+name: Update 3rd-party assets (daily)
+
+on:
+ schedule:
+ - cron: "29 4 * * *"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ if: github.repository_owner == 'uBlockOrigin'
+ permissions:
+ contents: write # for Git to git push
+ name: Update 3rd-party assets
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone uAssets
+ uses: actions/checkout@v3
+ - name: Fetch 3rd-party assets
+ run: |
+ ./tools/update-3rdparties.sh
+ - name: Commit changes, if any
+ run: |
+ if [[ -n $(git diff) ]]; then
+ git config user.name "github-actions bot"
+ git config user.email "<>"
+ git add -u thirdparties/
+ git commit -m "Update all 3rd-party assets"
+ git push origin master
+ fi
diff --git a/uAssets/.github/workflows/update-easylist.yml b/uAssets/.github/workflows/update-easylist.yml
new file mode 100644
index 0000000..4ae2b72
--- /dev/null
+++ b/uAssets/.github/workflows/update-easylist.yml
@@ -0,0 +1,32 @@
+name: Update Easylist assets (hourly)
+
+on:
+ schedule:
+ - cron: "47 */3 * * *"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ if: github.repository_owner == 'uBlockOrigin'
+ permissions:
+ contents: write # for Git to git push
+ name: Update Easylist assets
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone uAssets
+ uses: actions/checkout@v3
+ - name: Assemble Easylist assets
+ run: |
+ ./tools/make-easylist.sh
+ - name: Commit changes, if any
+ run: |
+ if [[ -n $(git diff) ]]; then
+ git config user.name "github-actions bot"
+ git config user.email "<>"
+ git add -u thirdparties/
+ git commit -m "Update Easylist assets"
+ git push origin master
+ fi