Skip to content

Commit 0ecebc4

Browse files
authored
Update Workflows and Dependencies (#2)
- Update Workflows - Update Dependencies
1 parent ed21d6b commit 0ecebc4

13 files changed

Lines changed: 3019 additions & 6801 deletions

File tree

.github/workflows/build.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ jobs:
1515
- name: "Checkout"
1616
uses: actions/checkout@v4
1717

18-
- name: "Setup Node"
18+
- name: "Setup Node 22"
1919
uses: actions/setup-node@v4
2020
with:
21-
node-version: 20
21+
node-version: 22
22+
cache: npm
23+
24+
- name: "Install"
25+
run: |
26+
npm install
2227
2328
- name: "Update Manifest Version"
2429
if: ${{ github.event_name == 'release' }}
2530
uses: cssnr/update-json-value-action@v1
2631

27-
- name: "Build All"
32+
- name: "Build"
2833
run: |
29-
npm ci
3034
npm run build
3135
3236
- name: "Upload to Actions"
37+
if: ${{ github.event_name == 'workflow_dispatch' }}
3338
uses: actions/upload-artifact@v4
3439
with:
3540
name: artifacts
@@ -39,8 +44,25 @@ jobs:
3944
if: ${{ github.event_name == 'release' }}
4045
uses: svenstaro/upload-release-action@v2
4146
with:
42-
repo_token: ${{ secrets.GITHUB_TOKEN }}
4347
file: web-ext-artifacts/*
4448
tag: ${{ github.ref }}
4549
overwrite: true
4650
file_glob: true
51+
52+
- name: "Update Release Notes Action"
53+
if: ${{ github.event_name == 'release' }}
54+
continue-on-error: true
55+
uses: smashedr/update-release-notes-action@master
56+
with:
57+
type: generic
58+
59+
- name: "Package Changelog Action"
60+
if: ${{ github.event_name == 'release' }}
61+
continue-on-error: true
62+
uses: cssnr/package-changelog-action@v1
63+
64+
- name: "Send Failure Notification"
65+
if: ${{ failure() && github.event_name == 'release' }}
66+
uses: sarisia/actions-status-discord@v1
67+
with:
68+
webhook: ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/draft.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Draft Release"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["master"]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
draft:
14+
name: "Draft Release"
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: "Checkout"
22+
uses: actions/checkout@v4
23+
24+
- name: "Draft Release Action"
25+
id: draft
26+
uses: cssnr/draft-release-action@master
27+
with:
28+
semver: patch
29+
prerelease: false
30+
31+
- name: "Process Release Draft URL"
32+
run: |
33+
echo "url: ${{ steps.draft.outputs.url }}"

.github/workflows/lint.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "Lint"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [master]
7+
push:
8+
branches: [master]
9+
10+
jobs:
11+
lint:
12+
name: "Lint"
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
if: ${{ !contains(github.event.head_commit.message, '#nolint') }}
16+
17+
steps:
18+
- name: "Checkout"
19+
uses: actions/checkout@v4
20+
21+
- name: "Setup Node 22"
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
#cache: npm
26+
27+
- name: "Install"
28+
id: install
29+
run: |
30+
npm install
31+
32+
- name: "ESLint"
33+
if: ${{ !cancelled() }}
34+
run: |
35+
npm run lint
36+
37+
- name: "Prettier"
38+
if: ${{ !cancelled() }}
39+
run: |
40+
npm run prettier
41+
42+
- name: "Yamllint"
43+
if: ${{ !cancelled() }}
44+
env:
45+
CONFIG: "{extends: relaxed, ignore: [node_modules/], rules: {line-length: {max: 119}}}"
46+
run: |
47+
echo "::group::List Files"
48+
yamllint -d '${{ env.CONFIG }}' --list-files .
49+
echo "::endgroup::"
50+
yamllint -d '${{ env.CONFIG }}' .
51+
52+
- name: "Actionlint"
53+
if: ${{ !cancelled() }}
54+
run: |
55+
echo "::group::Download"
56+
loc=$(curl -sI https://github.com/rhysd/actionlint/releases/latest | grep -i '^location:')
57+
echo "loc: ${loc}"
58+
tag=$(echo "${loc}" | sed -E 's|.*/tag/v?(.*)|\1|' | tr -d '\t\r\n')
59+
echo "tag: ${tag}"
60+
url="https://github.com/rhysd/actionlint/releases/latest/download/actionlint_${tag}_linux_amd64.tar.gz"
61+
echo "url: ${url}"
62+
curl -sL "${url}" | tar xz -C "${RUNNER_TEMP}" actionlint
63+
file "${RUNNER_TEMP}/actionlint"
64+
"${RUNNER_TEMP}/actionlint" --version
65+
echo "::endgroup::"
66+
"${RUNNER_TEMP}/actionlint" -color -verbose -shellcheck= -pyflakes=

.github/workflows/test.yaml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,54 @@ name: "Test"
22

33
on:
44
workflow_dispatch:
5+
schedule:
6+
- cron: "18 18 * * 1,3,5"
7+
pull_request:
8+
branches: [master]
59
push:
6-
# branches: ["master"]
7-
# paths:
8-
# - "src/**"
9-
# - "tests/**"
10-
# pull_request:
11-
# branches: ["master"]
12-
# paths:
13-
# - "src/**"
14-
# - "tests/**"
10+
branches: [master]
11+
#paths:
12+
# - ".github/workflows/test.yaml"
13+
# - "src/**"
14+
# - "tests/**"
15+
# - "gulpfile.js"
16+
# - "manifest.json"
17+
# - "package.json"
18+
# - "package-lock.json"
1519

1620
jobs:
1721
test:
1822
name: "Test"
1923
runs-on: ubuntu-latest
2024
timeout-minutes: 5
2125
if: ${{ !contains(github.event.head_commit.message, '#notest') }}
26+
permissions:
27+
contents: write
28+
pull-requests: write
2229

2330
steps:
2431
- name: "Checkout"
2532
uses: actions/checkout@v4
2633

27-
- name: "Setup Node"
34+
- name: "Setup Node 22"
2835
uses: actions/setup-node@v4
2936
with:
30-
node-version: 20
37+
node-version: 22
38+
#cache: npm
3139

3240
- name: "Install"
3341
run: |
34-
npm ci
35-
36-
- name: "Lint"
37-
run: |
38-
npm run lint
42+
npm install
3943
4044
- name: "Test"
45+
id: test
4146
run: |
4247
npm run test
4348
4449
- name: "Push Artifacts"
4550
uses: cssnr/push-artifacts-action@master
51+
if: ${{ github.event_name == 'pull_request' }}
52+
continue-on-error: true
4653
with:
4754
source: "tests/screenshots/"
4855
dest: "/static"
@@ -51,5 +58,11 @@ jobs:
5158
pass: ${{ secrets.RSYNC_PASS }}
5259
port: ${{ secrets.RSYNC_PORT }}
5360
webhost: "https://artifacts.hosted-domains.com"
61+
#webhook: ${{ secrets.DISCORD_WEBHOOK }}
62+
#token: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: "Schedule Failure Notification"
65+
uses: sarisia/actions-status-discord@v1
66+
if: ${{ always() && github.event_name == 'schedule' && steps.test.outcome == 'failure' }}
67+
with:
5468
webhook: ${{ secrets.DISCORD_WEBHOOK }}
55-
token: ${{ secrets.GITHUB_TOKEN }}

.prettierignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# IDE
2+
.idea/
3+
.vscode/
4+
5+
# Tools
6+
.ruff_cache/
7+
.mypy_cache/
8+
.pytest_cache/
9+
10+
# Build
11+
dist/
12+
node_modules/
13+
14+
# Files
15+
*.html

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
},
1313
{
14-
"files": ["**/*.json", "**/*.yaml", "**/*.yml"],
14+
"files": ["**/*.mjs", "**/*.json", "**/*.yaml", "**/*.yml"],
1515
"options": {
1616
"tabWidth": 2
1717
}

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cssnr_cache-cleaner&metric=alert_status&label=quality)](https://sonarcloud.io/summary/overall?id=cssnr_cache-cleaner)
1212
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/cache-cleaner?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/cache-cleaner/graphs/commit-activity)
1313
[![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/cache-cleaner?logo=htmx&logoColor=white)](https://github.com/cssnr/cache-cleaner)
14+
[![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/cache-cleaner?logo=bookstack&logoColor=white&label=repo%20size)](https://github.com/cssnr/cache-cleaner)
1415
[![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&logoColor=white&label=org%20stars)](https://cssnr.github.io/)
1516
[![Discord](https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/wXy6m2X8wY)
1617

@@ -31,21 +32,21 @@ More information on the individual APIs
3132
for [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browsingData)
3233
and [Chrome](https://developer.chrome.com/docs/extensions/reference/api/browsingData).
3334

34-
* [Install](#Install)
35-
* [Features](#Features)
35+
- [Install](#Install)
36+
- [Features](#Features)
3637
- [Upcoming Features](#Upcoming-Features)
3738
- [Known Issues](#Known-Issues)
38-
* [Configuration](#Configuration)
39-
* [Usage](#Usage)
40-
* [Support](#Support)
41-
* [Development](#Development)
39+
- [Configuration](#Configuration)
40+
- [Usage](#Usage)
41+
- [Support](#Support)
42+
- [Development](#Development)
4243
- [Building](#Building)
43-
* [Contributing](#Contributing)
44+
- [Contributing](#Contributing)
4445

4546
## Install
4647

47-
* [Google Chrome Web Store](https://chromewebstore.google.com/detail/cache-cleaner/nbkhplnnajkikghffmincdbipjalpobi)
48-
* [Mozilla Firefox Add-ons](https://addons.mozilla.org/addon/cache-cleaner-addon)
48+
- [Google Chrome Web Store](https://chromewebstore.google.com/detail/cache-cleaner/nbkhplnnajkikghffmincdbipjalpobi)
49+
- [Mozilla Firefox Add-ons](https://addons.mozilla.org/addon/cache-cleaner-addon)
4950

5051
[![Chrome](https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/chrome_48.png)](https://chromewebstore.google.com/detail/cache-cleaner/nbkhplnnajkikghffmincdbipjalpobi)
5152
[![Firefox](https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/firefox_48.png)](https://addons.mozilla.org/addon/cache-cleaner-addon)
@@ -210,15 +211,16 @@ or [Mozilla](https://addons.mozilla.org/addon/cache-cleaner-addon) and to star t
210211

211212
Other Web Extensions I have created and published:
212213

213-
- [Link Extractor](https://github.com/cssnr/link-extractor)
214-
- [Open Links in New Tab](https://github.com/cssnr/open-links-in-new-tab)
215-
- [Cache Cleaner](https://github.com/cssnr/cache-cleaner)
216-
- [Auto Auth](https://github.com/cssnr/auto-auth)
217-
- [HLS Video Downloader](https://github.com/cssnr/hls-video-downloader)
218-
- [SMWC Web Extension](https://github.com/cssnr/smwc-web-extension)
219-
- [PlayDrift Extension](https://github.com/cssnr/playdrift-extension)
220-
- [ASN Plus](https://github.com/cssnr/asn-plus)
221-
- [Aviation Tools](https://github.com/cssnr/aviation-tools)
222-
- [Text Formatter](https://github.com/cssnr/text-formatter)
214+
- [Link Extractor](https://github.com/cssnr/link-extractor?tab=readme-ov-file#readme)
215+
- [Open Links in New Tab](https://github.com/cssnr/open-links-in-new-tab?tab=readme-ov-file#readme)
216+
- [Auto Auth](https://github.com/cssnr/auto-auth?tab=readme-ov-file#readme)
217+
- [Cache Cleaner](https://github.com/cssnr/cache-cleaner?tab=readme-ov-file#readme)
218+
- [HLS Video Downloader](https://github.com/cssnr/hls-video-downloader?tab=readme-ov-file#readme)
219+
- [Obtainium Extension](https://github.com/cssnr/obtainium-extension?tab=readme-ov-file#readme)
220+
- [SMWC Web Extension](https://github.com/cssnr/smwc-web-extension?tab=readme-ov-file#readme)
221+
- [PlayDrift Extension](https://github.com/cssnr/playdrift-extension?tab=readme-ov-file#readme)
222+
- [ASN Plus](https://github.com/cssnr/asn-plus?tab=readme-ov-file#readme)
223+
- [Aviation Tools](https://github.com/cssnr/aviation-tools?tab=readme-ov-file#readme)
224+
- [Text Formatter](https://github.com/cssnr/text-formatter?tab=readme-ov-file#readme)
223225

224226
For a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/)

eslint.config.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
3+
export default [
4+
js.configs.recommended,
5+
{
6+
languageOptions: {
7+
ecmaVersion: 'latest',
8+
sourceType: 'module',
9+
},
10+
settings: {
11+
env: {
12+
browser: true,
13+
es2021: true,
14+
jquery: true,
15+
webextensions: true,
16+
},
17+
},
18+
rules: {
19+
'no-undef': 'off',
20+
'no-extra-semi': 'off',
21+
},
22+
},
23+
]

gulpfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ gulp.task('fontawesome', () => {
1717
'node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-*',
1818
'node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-*',
1919
],
20-
{ base: 'node_modules/@fortawesome/fontawesome-free' }
20+
{
21+
base: 'node_modules/@fortawesome/fontawesome-free',
22+
encoding: false,
23+
}
2124
)
2225
.pipe(gulp.dest('src/dist/fontawesome'))
2326
})

0 commit comments

Comments
 (0)