From 2c9d315f2800448d5f1c92ac1c91a33f6492c3bb Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Tue, 7 Apr 2026 18:23:42 +0200 Subject: [PATCH 1/5] ci: migrate from Woodpecker CI to Forgejo Actions Replace Woodpecker CI with GitHub/Forgejo Actions workflows matching the patterns used in mattermost-marketplace-ng. Add CI workflow with lint and build jobs, and release workflow with artifact upload. Also update .gitignore with web-ext-artifacts and AI tool entries. --- .github/workflows/ci.yml | 24 +++++++++++++++++++++++ .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ .gitignore | 9 +++++++++ .woodpecker/release.yml | 22 --------------------- styles.css | 14 +++++++++++--- 5 files changed, 80 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .woodpecker/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..942b685 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + lint: + runs-on: docker + container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v4 + - run: make lint + + build: + runs-on: docker + container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v4 + - run: make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bbc4bc9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + tags: ["v*"] + +jobs: + release: + runs-on: docker + container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v4 + + - name: Build extension + run: make build + + - name: Prepare artifacts + run: | + TAG=${GITHUB_REF#refs/tags/} + mkdir -p release + find web-ext-artifacts -name "*.zip" -exec mv {} release/webext-dark-mode-${TAG}.zip \; + cp release/webext-dark-mode-${TAG}.zip release/webext-dark-mode-${TAG}.xpi + + - name: Create release + uses: actions/forgejo-release@v2.6.0 + with: + direction: upload + tag: ${{ github.ref_name }} + title: ${{ github.ref_name }} + release-notes: "" + download-url: ${{ server_url }}/${{ github.repository }} + token: ${{ secrets.FORGEJO_TOKEN }} + release-dir: release + release-notes-assistant: "" diff --git a/.gitignore b/.gitignore index 3c0f63d..d060eeb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,12 @@ extension.zip .DS_Store node_modules/ *.log +web-ext-artifacts/ + +# AI tools +.serena +.cursor +.claude +CLAUDE.md +AGENTS.md +.playwright-mcp diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml deleted file mode 100644 index 8d995eb..0000000 --- a/.woodpecker/release.yml +++ /dev/null @@ -1,22 +0,0 @@ -when: - - event: tag - ref: refs/tags/v* - -steps: - - name: build - image: alpine:latest - commands: - - apk add --no-cache make nodejs npm - - make build - - find web-ext-artifacts -name "*.zip" -exec mv {} webext-dark-mode-${CI_COMMIT_TAG}.zip \; - - cp webext-dark-mode-${CI_COMMIT_TAG}.zip webext-dark-mode-${CI_COMMIT_TAG}.xpi - - - name: release - image: woodpeckerci/plugin-release - settings: - api_key: - from_secret: FORGEJO_TOKEN - files: - - webext-dark-mode-${CI_COMMIT_TAG}.zip - - webext-dark-mode-${CI_COMMIT_TAG}.xpi - title: ${CI_COMMIT_TAG} diff --git a/styles.css b/styles.css index 33a6b62..1ad9579 100644 --- a/styles.css +++ b/styles.css @@ -16,6 +16,14 @@ html.smart-dark-mode .smart-dark-mode-preserve { filter: invert(1) hue-rotate(180deg) !important; } +/* Re-invert fullscreen videos to preserve original colors */ +html.smart-dark-mode video:fullscreen, +html.smart-dark-mode video:-webkit-full-screen, +html.smart-dark-mode video:-moz-full-screen, +html.smart-dark-mode video:-ms-fullscreen { + filter: invert(1) hue-rotate(180deg) !important; +} + /* Prevent double inversion for media inside preserved containers */ html.smart-dark-mode .smart-dark-mode-preserve img, html.smart-dark-mode .smart-dark-mode-preserve video, @@ -28,6 +36,6 @@ html.smart-dark-mode .smart-dark-mode-preserve [style*="background-image"] { filter: none !important; } -/* Exclude already dark elements if possible - this is tricky with just CSS filters, - but we can try to exclude some common patterns if needed. - For now, the re-inversion is the main "smart" part. */ \ No newline at end of file +/* Exclude already dark elements if possible - this is tricky with just CSS filters, + but we can try to exclude some common patterns if needed. + For now, the re-inversion is the main "smart" part. */ -- 2.52.0 From 1396f93c2fe97c49cc9b7251be711ccad25aba20 Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Wed, 8 Apr 2026 10:43:40 +0200 Subject: [PATCH 2/5] build: migrate from npm to bun Replace npx with bunx in Makefile targets and drop setup-node steps from CI workflows (ci-base container provides bun). Also fix web-ext lint issues by adding browser_specific_settings.gecko with an extension ID and data_collection_permissions to the manifest. --- .github/workflows/ci.yml | 2 -- .github/workflows/release.yml | 2 -- .gitignore | 1 + Makefile | 4 ++-- manifest.json | 8 ++++++++ 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 942b685..3097bf1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 steps: - uses: actions/checkout@v6 - - uses: actions/setup-node@v4 - run: make lint build: @@ -20,5 +19,4 @@ jobs: container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 steps: - uses: actions/checkout@v6 - - uses: actions/setup-node@v4 - run: make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbc4bc9..b12062e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,6 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: actions/setup-node@v4 - - name: Build extension run: make build diff --git a/.gitignore b/.gitignore index d060eeb..53241c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ extension.zip .DS_Store node_modules/ +bun.lockb *.log web-ext-artifacts/ diff --git a/Makefile b/Makefile index 1f60a82..a9bbfb1 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ help: ## Show this help message build: ## Build the extension @echo "Building extension..." - @npx web-ext build --overwrite-dest + @bunx web-ext build --overwrite-dest clean: ## Remove build artifacts @echo "Cleaning up..." @@ -20,4 +20,4 @@ clean: ## Remove build artifacts lint: ## Lint the extension @echo "Linting..." - @npx web-ext lint + @bunx web-ext lint diff --git a/manifest.json b/manifest.json index 295a47d..0f3f4ae 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,14 @@ "activeTab", "scripting" ], + "browser_specific_settings": { + "gecko": { + "id": "smart-dark-mode@fmartingr.com", + "data_collection_permissions": { + "required": ["none"] + } + } + }, "action": { "default_popup": "popup.html", "default_icon": { -- 2.52.0 From 8f21ba0e584ac70cf79978a9f3f2302b00b24405 Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Wed, 8 Apr 2026 10:52:01 +0200 Subject: [PATCH 3/5] ci: use oven-sh/setup-bun action Explicitly install bun in CI workflows using the official setup-bun action instead of relying on the ci-base container. --- .github/workflows/ci.yml | 2 ++ .github/workflows/release.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3097bf1..f23616b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 steps: - uses: actions/checkout@v6 + - uses: oven-sh/setup-bun@v2 - run: make lint build: @@ -19,4 +20,5 @@ jobs: container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 steps: - uses: actions/checkout@v6 + - uses: oven-sh/setup-bun@v2 - run: make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b12062e..e6e9dca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,8 @@ jobs: steps: - uses: actions/checkout@v6 + - uses: oven-sh/setup-bun@v2 + - name: Build extension run: make build -- 2.52.0 From 752751d956a2e654bb54d928a03d334b9232f70e Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Wed, 8 Apr 2026 10:59:20 +0200 Subject: [PATCH 4/5] ci: use actions/setup-bun --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f23616b..92a9608 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 steps: - uses: actions/checkout@v6 - - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-bun@v2 - run: make lint build: @@ -20,5 +20,5 @@ jobs: container: git.nakama.town/fmartingr/ci-images/ci-base:1.0.0 steps: - uses: actions/checkout@v6 - - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-bun@v2 - run: make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6e9dca..22c79db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-bun@v2 - name: Build extension run: make build -- 2.52.0 From f66b0290b9b820b220ed1ba66f4c566837e38294 Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Wed, 8 Apr 2026 11:05:42 +0200 Subject: [PATCH 5/5] build: force bun runtime for web-ext The ci-base container ships an older Node.js where undici's dependency on the global File API fails. Passing --bun to bunx runs web-ext through bun's runtime, avoiding the stale system node entirely. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a9bbfb1..dfbe661 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ help: ## Show this help message build: ## Build the extension @echo "Building extension..." - @bunx web-ext build --overwrite-dest + @bunx --bun web-ext build --overwrite-dest clean: ## Remove build artifacts @echo "Cleaning up..." @@ -20,4 +20,4 @@ clean: ## Remove build artifacts lint: ## Lint the extension @echo "Linting..." - @bunx web-ext lint + @bunx --bun web-ext lint -- 2.52.0