ci: migrate from Woodpecker CI to Forgejo Actions #1
7 changed files with 91 additions and 27 deletions
24
.github/workflows/ci.yml
vendored
Normal file
24
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -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-bun@v2
|
||||
- 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-bun@v2
|
||||
- run: make build
|
||||
36
.github/workflows/release.yml
vendored
Normal file
36
.github/workflows/release.yml
vendored
Normal file
|
|
@ -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-bun@v2
|
||||
|
||||
- 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: ""
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
|
|
@ -1,4 +1,14 @@
|
|||
extension.zip
|
||||
.DS_Store
|
||||
node_modules/
|
||||
bun.lockb
|
||||
*.log
|
||||
web-ext-artifacts/
|
||||
|
||||
# AI tools
|
||||
.serena
|
||||
.cursor
|
||||
.claude
|
||||
CLAUDE.md
|
||||
AGENTS.md
|
||||
.playwright-mcp
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
4
Makefile
4
Makefile
|
|
@ -12,7 +12,7 @@ help: ## Show this help message
|
|||
|
||||
build: ## Build the extension
|
||||
@echo "Building extension..."
|
||||
@npx 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..."
|
||||
@npx web-ext lint
|
||||
@bunx --bun web-ext lint
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
14
styles.css
14
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. */
|
||||
/* 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. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue