Skip to content

ci(publish): build & publish the skainet-backend-jni-cpu AAR on release (#946) - #947

Merged
michalharakal merged 2 commits into
developfrom
fix/publish-jni-aar-946
Aug 10, 2026
Merged

michalharakal merged 2 commits into
developfrom
fix/publish-jni-aar-946

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Closes the AAR-publishing gap from the 0.39.0 release checklist (#946). Since the JNI module merged to develop, ./gradlew publish (macOS publish job) now includes an Android library whose AAR carries NDK-cross-built .sos — but the runner has no Android SDK/NDK, so a release would fail to build the AAR or ship no JNI artifact. That artifact is the whole Android NEON win (~24 tok/s SmolLM2-135M decode measured on a Pixel 8a vs 3.8 scalar), so it has to be in the release.

Changes

  • Pin the NDK in gradle/libs.versions.toml (android-ndk = 28.2.13676358) and reference it from the module's ndkVersion — reproducible .so builds on dev machines and CI. r28+ links 16 KB-page-aligned .sos (Android 15+).
  • publish.yml publish job: set up the Android SDK and install the pinned NDK (version read from the catalog) before ./gradlew publish. Independent of the build-native matrix (which only makes the FFM shared libs).

Verified locally

publishToMavenLocal produces a complete artifact:

skainet-backend-jni-cpu-<v>.aar        (arm64-v8a + x86_64: libskainet_jni.so + libskainet_jni_v82.so)
  proguard.txt                          (consumer ServiceLoader/JNI keep rules)
skainet-backend-jni-cpu-<v>.pom         (groupId sk.ainet.core, dep skainet-backend-api)
  + sources.jar, javadoc.jar, .module

assembleRelease green with the pinned NDK; publish.yml passes yaml.safe_load.

Needs a maintainer eye

  1. Pin android-actions/setup-android to a commit SHA per repo convention — I left it as @v3 with an inline note because I couldn't verify the SHA offline.
  2. The workflow change itself is only fully exercised by a real tagged release (or a fork tag). The Gradle side is verified locally; the CI YAML is not.

Part of the #946 release checklist; prerequisite for the mobile NEON work to be consumable by SKaiNET-transformers apps.

Refs #946 #920

Since the JNI module landed on develop, `./gradlew publish` (run on the
macOS publish job) includes an Android library whose AAR carries
NDK-cross-built .so's — but the runner had no Android SDK/NDK, so a release
would fail to build the AAR or silently ship no JNI artifact. That artifact
is the entire Android NEON story (measured ~24 tok/s SmolLM2 decode on a
Pixel 8a vs 3.8 scalar), so it must be in the release.

- Pin the NDK in gradle/libs.versions.toml (android-ndk = 28.2.13676358)
  and reference it from the module's ndkVersion, so the AAR's .so's build
  reproducibly on dev machines and CI. r28+ links 16 KB-page-aligned .so's
  (Android 15+ requirement).
- publish.yml publish job: set up the Android SDK and install the pinned
  NDK (version read from the catalog) before ./gradlew publish. Independent
  of the build-native matrix, which only produces the FFM shared libs.

Verified locally: publishToMavenLocal produces a complete AAR —
arm64-v8a + x86_64 libskainet_jni{,_v82}.so, consumer proguard.txt, POM
with the skainet-backend-api dependency, sources + javadoc + module
metadata. assembleRelease green with the pinned NDK. YAML validated.

The CI YAML itself is only verifiable by a real release run; the
android-actions/setup-android ref is left as a tag with a maintainer note
to pin it to a SHA (couldn't verify the SHA offline).

Refs #946 #920
Comment thread .github/workflows/publish.yml Fixed
Resolves the Scorecard pinned-dependencies finding on #947. Pin to the
verified commit for v3.2.2 (9fc6c4e), replacing the placeholder @V3 tag.

Refs #946 #920
@michalharakal

Copy link
Copy Markdown
Contributor Author

Pinned android-actions/setup-android to the verified commit SHA for v3.2.2 (9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407, resolved via the GitHub tags API) — resolves the Scorecard pinned-dependencies finding. That was the one maintainer-flagged item; the workflow is now fully SHA-pinned per repo convention.

@michalharakal
michalharakal requested a review from aharakal August 10, 2026 15:54
@michalharakal
michalharakal merged commit 0ca6309 into develop Aug 10, 2026
11 checks passed
@michalharakal
michalharakal deleted the fix/publish-jni-aar-946 branch August 10, 2026 19:26
michalharakal added a commit to MacOS/SKaiNET that referenced this pull request Aug 11, 2026
Bump VERSION_NAME 0.38.0 -> 0.39.0 and update all version-carrying docs:
- CHANGELOG: consolidate [Unreleased] under [0.39.0] with a headline summary
  (includes the SKaiNET-developers#947 AAR-publishing CI entry, now merged to develop).
- README: BOM snippet -> 0.39.0, What's New in 0.39.0, Contributors (0.39.0).
- docs/antora.yml: skainet_version attribute 0.38.0 -> 0.39.0 (used in the
  docs' dependency snippets).
- kernel-support-matrix.adoc: regenerated via generateKernelMatrix — the
  Android column now shows native-jni for Q8_0/Q4_0/Q4_K/Q5_K/Q6_K (the new
  JNI backend), replacing panama-vector; version stamp -> 0.39.0.

0.39.0 headline: on-device AI on Android becomes real — the
skainet-backend-jni-cpu JNI NEON backend (~24 tok/s SmolLM2-135M Q8_0 on a
Pixel 8a vs ~3.8 scalar), plus Android streaming GGUF loads (SKaiNET-developers#922), linkable
K/N kernel klibs (SKaiNET-developers#942), the Q4_0 NEON kernel (SKaiNET-developers#939), GGUF loader fail-fast
(SKaiNET-developers#919), and a tensor-storage correctness pass (SKaiNET-developers#927-SKaiNET-developers#931).

Local prep only — not pushed/tagged. Cut off develop after SKaiNET-developers#947 merged, so
the branch already carries the AAR-publishing workflow + pinned NDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants