1- name : Build and Release XCFrameworks
1+ name : Build and Release RACommons
22
33# =============================================================================
4- # This workflow builds modular XCFrameworks for iOS/macOS:
5- # - RACommons.xcframework (core commons library)
6- # - RABackendLlamaCPP.xcframework (LLM backend)
7- # - RABackendONNX.xcframework (STT/TTS/VAD backend)
4+ # RACommons Release Workflow
85#
9- # It downloads runanywhere-core source from runanywhere-binaries releases,
10- # builds the XCFrameworks, and publishes them as a GitHub release on this repo.
6+ # Builds RACommons.xcframework - the standalone infrastructure library.
7+ # This does NOT build backends (LlamaCPP, ONNX, WhisperCPP) - those are
8+ # released from runanywhere-core repository.
119#
1210# Trigger:
1311# - Tag push: commons-v*
1412# - Manual workflow_dispatch
15- #
1613# =============================================================================
1714
1815on :
2219 workflow_dispatch :
2320 inputs :
2421 version :
25- description : ' Version to release (e.g., 2.0 .0)'
22+ description : ' Version to release (e.g., 0.2 .0)'
2623 required : true
2724 type : string
28- core_version :
29- description : ' runanywhere-core version to use (leave empty for latest)'
30- required : false
31- type : string
3225 dry_run :
3326 description : ' Dry run (build only, do not publish)'
3427 required : false
@@ -39,19 +32,17 @@ permissions:
3932 contents : read
4033
4134env :
42- # Working directory for commons
4335 COMMONS_DIR : sdk/runanywhere-commons
4436
4537jobs :
4638 # ===========================================================================
47- # Build iOS XCFrameworks
39+ # Build iOS XCFramework
4840 # ===========================================================================
4941 build-ios :
50- name : Build iOS XCFrameworks
42+ name : Build iOS
5143 runs-on : macos-14
5244 outputs :
5345 version : ${{ steps.version.outputs.version }}
54- core_version : ${{ steps.core.outputs.core_version }}
5546
5647 steps :
5748 - name : Checkout
6657 VERSION="${GITHUB_REF#refs/tags/commons-v}"
6758 fi
6859 echo "version=$VERSION" >> $GITHUB_OUTPUT
69- echo "Building version: $VERSION"
60+ echo "Building RACommons v $VERSION"
7061
7162 - name : Setup Xcode
7263 uses : maxim-lobanov/setup-xcode@v1
@@ -76,169 +67,205 @@ jobs:
7667 - name : Install Dependencies
7768 run : brew install cmake ninja
7869
79- - name : Download runanywhere-core Source
80- id : core
70+ - name : Setup Development Config
8171 working-directory : ${{ env.COMMONS_DIR }}
8272 run : |
83- chmod +x scripts/download-core.sh
84-
85- # Determine core version
86- if [ -n "${{ github.event.inputs.core_version }}" ]; then
87- CORE_VERSION="${{ github.event.inputs.core_version }}"
88- else
89- CORE_VERSION="0.1.1-dev.03aacf9"
73+ # Create development_config.cpp from template (gitignored)
74+ if [ -f src/infrastructure/network/development_config.cpp.template ]; then
75+ cp src/infrastructure/network/development_config.cpp.template \
76+ src/infrastructure/network/development_config.cpp
9077 fi
9178
92- echo "Using core version: $CORE_VERSION"
93- echo "core_version=$CORE_VERSION" >> $GITHUB_OUTPUT
94-
95- RUNANYWHERE_CORE_VERSION="$CORE_VERSION" ./scripts/download-core.sh
79+ - name : Build RACommons XCFramework
80+ working-directory : ${{ env.COMMONS_DIR }}
81+ run : |
82+ chmod +x scripts/build-rac-commons.sh
83+ ./scripts/build-rac-commons.sh --ios --release --package
9684
97- - name : Verify Downloads
85+ - name : List Artifacts
9886 working-directory : ${{ env.COMMONS_DIR }}
9987 run : |
100- echo "=== Verifying Downloads ==="
101- # Check core source
102- if [ ! -f "third_party/runanywhere-core/CMakeLists.txt" ]; then
103- echo "ERROR: runanywhere-core not downloaded"
104- exit 1
88+ echo "=== Build Artifacts ==="
89+ ls -la dist/
90+ if [ -d dist/packages ]; then
91+ echo ""
92+ echo "=== Packages ==="
93+ ls -la dist/packages/
10594 fi
106- echo "✓ Core: $(cat third_party/runanywhere-core/DOWNLOADED_VERSION)"
10795
108- # Check ONNX Runtime (in commons third_party/ for FetchONNXRuntime.cmake)
109- if [ ! -d "third_party/onnxruntime-ios/onnxruntime.xcframework" ]; then
110- echo "ERROR: onnxruntime.xcframework not downloaded"
111- exit 1
112- fi
113- echo "✓ ONNX Runtime (third_party/onnxruntime-ios/)"
96+ - name : Upload Artifacts
97+ uses : actions/upload-artifact@v4
98+ with :
99+ name : racommons-ios-${{ steps.version.outputs.version }}
100+ path : |
101+ ${{ env.COMMONS_DIR }}/dist/RACommons.xcframework
102+ ${{ env.COMMONS_DIR }}/dist/packages/*.zip
103+ ${{ env.COMMONS_DIR }}/dist/packages/*.sha256
104+ retention-days : 30
114105
115- # Check Sherpa-ONNX (inside runanywhere-core/third_party/ for ONNX backend CMake)
116- if [ ! -d "third_party/runanywhere-core/third_party/sherpa-onnx-ios/sherpa-onnx.xcframework" ]; then
117- echo "ERROR: sherpa-onnx.xcframework not downloaded"
118- exit 1
119- fi
120- echo "✓ Sherpa-ONNX (third_party/runanywhere-core/third_party/sherpa-onnx-ios/)"
106+ # ===========================================================================
107+ # Build Android Libraries
108+ # ===========================================================================
109+ build-android :
110+ name : Build Android (${{ matrix.abi }})
111+ runs-on : ubuntu-latest
112+ outputs :
113+ version : ${{ steps.version.outputs.version }}
114+ strategy :
115+ fail-fast : false
116+ matrix :
117+ abi : [arm64-v8a, armeabi-v7a, x86_64]
121118
122- echo ""
123- echo "=== third_party/ contents ==="
124- ls -la third_party/
125- echo ""
126- echo "=== third_party/runanywhere-core/third_party/ contents ==="
127- ls -la third_party/runanywhere-core/third_party/
119+ steps :
120+ - name : Checkout
121+ uses : actions/checkout@v4
128122
129- - name : Setup Development Config
130- working-directory : ${{ env.COMMONS_DIR }}
123+ - name : Determine Version
124+ id : version
131125 run : |
132- # Create development_config.cpp from template (gitignored, contains placeholders)
133- cp src/infrastructure/network/development_config.cpp.template \
134- src/infrastructure/network/development_config.cpp
126+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
127+ VERSION="${{ github.event.inputs.version }}"
128+ else
129+ VERSION="${GITHUB_REF#refs/tags/commons-v}"
130+ fi
131+ echo "version=$VERSION" >> $GITHUB_OUTPUT
135132
136- - name : Build iOS XCFrameworks
137- working-directory : ${{ env.COMMONS_DIR }}
138- run : |
139- chmod +x scripts/build-ios.sh
140- ./scripts/build-ios.sh
133+ - name : Setup JDK
134+ uses : actions/setup-java@v4
135+ with :
136+ distribution : ' temurin '
137+ java-version : ' 17 '
141138
142- - name : Package Release
143- working-directory : ${{ env.COMMONS_DIR }}
139+ - name : Setup Android SDK
140+ uses : android-actions/setup-android@v3
141+
142+ - name : Setup NDK
144143 run : |
145- chmod +x scripts/package-release.sh
146- ./scripts/package-release.sh ${{ steps.version.outputs.version }}
144+ NDK_VERSION="27.0.12077973"
145+ echo "y" | sdkmanager --install "ndk;${NDK_VERSION}" --sdk_root=${ANDROID_SDK_ROOT}
146+ echo "ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION}" >> $GITHUB_ENV
147147
148- - name : List Artifacts
148+ - name : Build Android ${{ matrix.abi }}
149149 working-directory : ${{ env.COMMONS_DIR }}
150150 run : |
151- echo "=== Build Artifacts ==="
152- ls -la dist/
153- echo ""
154- echo "=== XCFramework Sizes ==="
155- for xcf in dist/*.xcframework; do
156- if [ -d "$xcf" ]; then
157- size=$(du -sh "$xcf" | cut -f1)
158- echo " $(basename "$xcf"): $size"
159- fi
160- done
151+ chmod +x scripts/build-rac-commons.sh
152+ ./scripts/build-rac-commons.sh --android --abi ${{ matrix.abi }} --release
161153
162- - name : Upload Artifacts
154+ - name : Upload Artifact
163155 uses : actions/upload-artifact@v4
164156 with :
165- name : xcframeworks -${{ steps.version.outputs.version }}
157+ name : racommons-android-${{ matrix.abi }} -${{ steps.version.outputs.version }}
166158 path : |
167- ${{ env.COMMONS_DIR }}/dist/*.xcframework.zip
168- ${{ env.COMMONS_DIR }}/dist/*.zip
169- ${{ env.COMMONS_DIR }}/dist/*.sha256
170- ${{ env.COMMONS_DIR }}/dist/MANIFEST.md
159+ ${{ env.COMMONS_DIR }}/dist/android/
171160 retention-days : 30
172161
173162 # ===========================================================================
174- # Publish Release to this repo (runanywhere-sdks)
163+ # Publish Release
175164 # ===========================================================================
176165 publish :
177166 name : Publish Release
178- needs : build-ios
167+ needs : [ build-ios, build-android]
179168 if : github.event.inputs.dry_run != 'true'
180169 runs-on : ubuntu-latest
181170 permissions :
182171 contents : write
183172
184173 steps :
185- - name : Download Artifacts
174+ - name : Download iOS Artifact
175+ uses : actions/download-artifact@v4
176+ with :
177+ name : racommons-ios-${{ needs.build-ios.outputs.version }}
178+ path : dist/ios
179+
180+ - name : Download Android Artifacts
186181 uses : actions/download-artifact@v4
187182 with :
188- name : xcframeworks-${{ needs.build-ios.outputs.version }}
189- path : dist
183+ pattern : racommons-android-*
184+ path : dist/android-artifacts
185+ merge-multiple : false
190186
191- - name : List Downloaded Artifacts
187+ - name : Prepare Release Assets
192188 run : |
193- echo "=== Downloaded Artifacts ==="
194- ls -laR dist/
189+ VERSION="${{ needs.build-ios.outputs.version }}"
190+ mkdir -p release-assets
191+
192+ # iOS assets
193+ if [ -d dist/ios/packages ]; then
194+ cp dist/ios/packages/*.zip release-assets/ 2>/dev/null || true
195+ cp dist/ios/packages/*.sha256 release-assets/ 2>/dev/null || true
196+ fi
197+
198+ # Package iOS XCFramework if not already packaged
199+ if [ -d dist/ios/RACommons.xcframework ] && [ ! -f release-assets/*ios*.zip ]; then
200+ cd dist/ios
201+ zip -r "../../release-assets/RACommons-ios-v${VERSION}.zip" RACommons.xcframework
202+ cd ../../release-assets
203+ shasum -a 256 "RACommons-ios-v${VERSION}.zip" > "RACommons-ios-v${VERSION}.zip.sha256"
204+ fi
205+
206+ # Combine Android ABIs
207+ mkdir -p android-combined/jniLibs
208+ for dir in dist/android-artifacts/racommons-android-*/android/jniLibs/*/; do
209+ if [ -d "$dir" ]; then
210+ abi=$(basename "$dir")
211+ mkdir -p "android-combined/jniLibs/${abi}"
212+ cp -r "${dir}"* "android-combined/jniLibs/${abi}/" 2>/dev/null || true
213+ fi
214+ done
215+
216+ # Copy headers
217+ HEADER_DIR=$(find dist/android-artifacts -name "include" -type d | head -1)
218+ if [ -n "$HEADER_DIR" ]; then
219+ cp -r "$HEADER_DIR" android-combined/
220+ fi
221+
222+ # Package Android
223+ cd android-combined
224+ zip -r "../release-assets/RACommons-android-v${VERSION}.zip" .
225+ cd ../release-assets
226+ shasum -a 256 "RACommons-android-v${VERSION}.zip" > "RACommons-android-v${VERSION}.zip.sha256"
227+
228+ echo "=== Release Assets ==="
229+ ls -la
195230
196231 - name : Create GitHub Release
197232 uses : softprops/action-gh-release@v2
198233 with :
199234 tag_name : commons-v${{ needs.build-ios.outputs.version }}
200- name : RunAnywhere Commons v${{ needs.build-ios.outputs.version }}
235+ name : RACommons v${{ needs.build-ios.outputs.version }}
201236 files : |
202- dist/** /*.zip
203- dist/** /*.sha256
237+ release-assets /*.zip
238+ release-assets /*.sha256
204239 body : |
205- ## RunAnywhere Commons v${{ needs.build-ios.outputs.version }}
206-
207- Modular XCFrameworks for iOS/macOS.
240+ ## RACommons v${{ needs.build-ios.outputs.version }}
208241
209- ### XCFrameworks
242+ Standalone infrastructure library for RunAnywhere SDKs.
210243
211- | Framework | Description |
212- |-----------|-------------|
213- | `RACommons.xcframework` | Core commons library (service registry, model management) |
214- | `RABackendLlamaCPP.xcframework` | LLM backend (llama.cpp + Metal) |
215- | `RABackendONNX.xcframework` | STT/TTS/VAD backend (Sherpa-ONNX) |
244+ ### Contents
245+ - Logging, error handling, and event tracking
246+ - Service registry and provider infrastructure
247+ - Model management (download strategies, storage)
248+ - Platform backend (Apple Foundation Models, System TTS) - iOS/macOS only
216249
217- ### Swift Package Manager
250+ ### iOS/macOS
251+ `RACommons-ios-v${{ needs.build-ios.outputs.version }}.zip`
252+ - Contains `RACommons.xcframework`
218253
219- Update your `Package.swift`:
254+ ### Android
255+ `RACommons-android-v${{ needs.build-ios.outputs.version }}.zip`
256+ - Contains `jniLibs/{abi}/librac_commons.so`
257+ - Contains `include/` headers
220258
221- ```swift
222- .binaryTarget(
223- name: "RACommonsBinary",
224- url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/commons-v${{ needs.build-ios.outputs.version }}/RACommons-${{ needs.build-ios.outputs.version }}.zip",
225- checksum: "..."
226- ),
227- ```
228-
229- ### Requirements
230-
231- - **ONNX Runtime**: `RABackendONNX` requires `onnxruntime.xcframework` (download separately)
232- - **Platforms**: iOS 17+, macOS 14+
259+ ### Note
260+ Backend libraries (LlamaCPP, ONNX, WhisperCPP) are released separately from `runanywhere-core`.
233261
234262 ### Verification
235-
236263 ```bash
237264 shasum -a 256 -c *.sha256
238265 ```
239266
240267 ---
241- Built with runanywhere-core: ${{ needs.build-ios.outputs.core_version }}
268+ Built from runanywhere-sdks @ ${{ github.sha }}
242269 draft : false
243270 prerelease : false
244271 env :
0 commit comments