Replace fragile Niadd patch with patch script
Build Futon with Niadd patch / Build debug APK (push) Successful in 12m49s
Build Futon with Niadd patch / Build debug APK (push) Successful in 12m49s
This commit is contained in:
3 files changed
+128
-48
No files matched your search
@@ -6,7 +6,7 @@ on:
|
||||
- main
|
||||
paths:
|
||||
- ".gitea/workflows/build.yml"
|
||||
- "patches/**"
|
||||
- "scripts/**"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
@@ -62,21 +62,34 @@ jobs:
|
||||
git -C work/Futon rev-parse HEAD
|
||||
git -C work/kotatsu-parsers-redo rev-parse HEAD
|
||||
|
||||
- name: Check and apply Niadd parser patch
|
||||
- name: Apply Niadd parser modifications
|
||||
shell: bash
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
|
||||
PATCH_FILE="${PWD}/patches/ninemanga-niadd.patch"
|
||||
python3 scripts/patch_ninemanga_niadd.py \
|
||||
work/kotatsu-parsers-redo
|
||||
|
||||
git -C work/kotatsu-parsers-redo apply --check "${PATCH_FILE}"
|
||||
git -C work/kotatsu-parsers-redo apply "${PATCH_FILE}"
|
||||
PARSER_FILE="work/kotatsu-parsers-redo/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt"
|
||||
|
||||
grep -F '"ru.niadd.com"' \
|
||||
work/kotatsu-parsers-redo/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt
|
||||
echo "=== Verify Niadd domain ==="
|
||||
grep -F '"ru.niadd.com"' "${PARSER_FILE}"
|
||||
|
||||
grep -F '@MangaSourceParser("NINEMANGA_RU", "Niadd Русский", "ru")' \
|
||||
work/kotatsu-parsers-redo/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt
|
||||
echo "=== Verify source annotation ==="
|
||||
grep -F '@MangaSourceParser("NINEMANGA_RU", "Niadd Русский", "ru")' "${PARSER_FILE}"
|
||||
|
||||
echo "=== Verify Niadd pagination ==="
|
||||
grep -F 'domain.endsWith("niadd.com")' "${PARSER_FILE}"
|
||||
|
||||
echo "=== Ensure old Russian domain is gone ==="
|
||||
if grep -F '"ru.ninemanga.com"' "${PARSER_FILE}"; then
|
||||
echo "ERROR: old ru.ninemanga.com domain is still present"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== Resulting diff ==="
|
||||
git -C work/kotatsu-parsers-redo diff -- \
|
||||
src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt
|
||||
|
||||
- name: Connect Futon to patched local parsers
|
||||
shell: bash
|
||||
|
||||
Reference in new issue
Block a user