The metadata and android targets build directly on the host
(./gradlew :network:compileKotlinMetadata, :network:compileDebugKotlinAndroid,
:network:testDebugUnitTest). The OHOS target needs the OpenHarmony SDK,
which is not on the host — but the CI image ships it, so on a Linux box with
Docker you can compile (and thus validate) ohosArm64 locally instead of
waiting on CI:
docker pull ghcr.io/bytemain/harmony-next-pipeline-docker/harmonyos-ci-image:latest
# Persist gradle + konan caches across runs (first run extracts the konan
# toolchain + downloads deps; later runs are ~fast).
docker volume create kba-gradle
docker volume create kba-konan
docker run --rm \
-v "$HOME/work/kuiklybase-components":/work \
-v kba-gradle:/root/.gradle \
-v kba-konan:/root/.konan \
-w /work/NetworkKMM \
ghcr.io/bytemain/harmony-next-pipeline-docker/harmonyos-ci-image:latest \
bash -lc '
git config --global --add safe.directory "*"
export OHOS_SDK_HOME="$OHOS_BASE_SDK_HOME" # konan reads OHOS_SDK_HOME, not OHOS_BASE_SDK_HOME
./gradlew :network:compileKotlinOhosArm64 --no-daemon --console=plain
'Key points:
- The image sets
OHOS_BASE_SDK_HOMEbut konan looks upOHOS_SDK_HOME— export it or you getOHOS SDK is not found in '/usr/local/lib/DevEco-Studio/...'. - Use
--no-daemon; the container is single-use. - Mount the repo read-write (the build writes
build/dirs; they end up root-owned on the host — clean withsudo rm -rfif needed). - This validates OHOS-side Kotlin and cinterop compiles. The native
.soitself (pbcurlwrapper) is still rebuilt + committed via thenetworkkmm-ohos-native.ymlworkflow (commit_binaries), same as raft.3/4.
A wrapper .cpp/header change makes the committed Android .so, iOS xcframework and OHOS .so
stale; the PR's freshness gates fail until they are rebuilt. Dispatch, one at a time on the PR
branch (each commits to it): networkkmm-android-native.yml, networkkmm-ios-native.yml,
networkkmm-ohos-native.yml, each with commit_binaries=true. Those commits carry [skip ci],
so afterwards push one more ordinary commit (not empty, not [skip ci]) so the pull_request
checks — including the freshness gates — run on the final head before review/merge.
- Merge the change to
master; bumpNetworkKMM/gradle.propertiesmavenVersion+ add aNetworkKMM/CHANGELOG-raft.mdentry. - If any
.cpp/header changed, dispatchnetworkkmm-ohos-native.ymlwithcommit_binaries=truefirst (rebuilds + commits the.so). - Dispatch
publish-network-github-packages.ymlwithversion=0.1.0-raft.N(builds all targets incl. iOS on mac, then publishes the original GAVs to both GitHub Packages and Raft Artifacts). The jobs require the protectedraft-artifacts-productionenvironment and its scope-limitedRAFT_ARTIFACTS_PUBLISH_TOKEN; do not bypass the clean-checkout, source-SHA, immutable-state, or two-repository convergence gates. - To consume locally (the dev box cannot read GitHub Packages — 401 without
read:packages), publish to mavenLocal from source:./gradlew :network:publishKotlinMultiplatformPublicationToMavenLocal :network:publishAndroidPublicationToMavenLocal(the Android publication is namedandroid, notandroidRelease).