Skip to content

Commit ffe77ef

Browse files
committed
ci: add automatic docs-version consistency check against Maven Central
build.yml/build-sample.yml are workflow_dispatch-only (heavy OpenCV build), so this check needed its own lightweight, auto-triggered workflow. Fails if README.md's install snippet drifts from the version actually live on Maven Central.
1 parent 0be056e commit ffe77ef

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI (docs check)
2+
3+
# Lightweight, auto-triggered check — separate from build.yml/build-sample.yml
4+
# (workflow_dispatch only, since the full OpenCV build is heavy/slow).
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
docs-version-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Docs version consistency check
18+
# Source of truth = what's ACTUALLY live on Maven Central (not gradle.properties'
19+
# VERSION, which can be bumped locally without ever being published).
20+
run: |
21+
V=$(curl -sf "https://repo1.maven.org/maven2/dev/ffmpegkit-maintained/opencv-contrib-android/maven-metadata.xml" \
22+
| grep -oP '<release>\K[^<]+')
23+
if [ -z "$V" ]; then
24+
echo "::error::could not fetch the current release version from Maven Central metadata"
25+
exit 1
26+
fi
27+
echo "Live on Maven Central: $V"
28+
if ! grep -q "dev.ffmpegkit-maintained:opencv-contrib-android:$V" README.md; then
29+
echo "::error file=README.md::does not mention the Maven Central version ($V) — likely stale."
30+
exit 1
31+
fi
32+
echo "README.md is in sync with $V."

0 commit comments

Comments
 (0)