Bump version #141
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Package | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Trigger on tags like v1.0.0 | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Self-hosted runners persist /nix/store; avoid stale Magic Nix Cache hooks/proxies. | |
| NIX_CONFIG: | | |
| post-build-hook = | |
| extra-substituters = | |
| substituters = https://cache.nixos.org/ | |
| jobs: | |
| rust_typescript_checks_tests: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Check formatting (bark-cpp) | |
| run: nix develop .# --command bash -c "unset SDKROOT && cd bark-cpp && cargo fmt -- --check" | |
| - name: Run tests (bark-cpp) | |
| run: nix develop .# --command bash -c "unset SDKROOT && cd bark-cpp && cargo test" | |
| - name: Install React Native app dependencies | |
| run: nix develop .# --command bash -c "cd react-native-nitro-ark && yarn install --immutable" | |
| - name: Prepare React Native package (lint, typecheck, build) | |
| run: nix develop .# --command bash -c "cd react-native-nitro-ark && yarn prepare" | |
| build_android_binaries_and_example: | |
| runs-on: ubuntu-self-hosted | |
| needs: rust_typescript_checks_tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Build bark-cpp for Android | |
| run: nix develop .# --command bash -c "unset SDKROOT && cd bark-cpp && ./build-android.sh" | |
| - name: Zip Android binaries | |
| run: cd bark-cpp/target && zip -r jniLibs.zip jniLibs | |
| shell: bash | |
| - name: Upload Android binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jniLibs-android-zip | |
| path: bark-cpp/target/jniLibs.zip | |
| - name: Install React Native app dependencies | |
| run: nix develop .# --command bash -c "cd react-native-nitro-ark && yarn install --immutable" | |
| - name: Build example Android app | |
| run: nix develop .# --command bash -c "cd react-native-nitro-ark && yarn example build:android" | |
| build_ios_binaries_and_example: | |
| runs-on: macOS | |
| needs: rust_typescript_checks_tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Build bark-cpp for iOS | |
| run: nix develop .# --command bash -c "unset SDKROOT && cd bark-cpp && ./build-ios.sh" | |
| - name: Zip iOS Framework | |
| run: cd bark-cpp && zip -r target/Ark.xcframework.zip target/Ark.xcframework | |
| shell: bash | |
| - name: Upload iOS binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Ark.xcframework-zip | |
| path: bark-cpp/target/Ark.xcframework.zip | |
| - name: Zip iOS Rust cxx bridge Framework | |
| run: cd bark-cpp && zip -r target/ArkCxxBridge.xcframework.zip target/ArkCxxBridge.xcframework | |
| shell: bash | |
| - name: Upload iOS Rust cxx bridge binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ArkCxxBridge.xcframework-zip | |
| path: bark-cpp/target/ArkCxxBridge.xcframework.zip | |
| - name: Install React Native app dependencies and Bundle for iOS example | |
| run: nix develop .# --command bash -c "cd react-native-nitro-ark && yarn install --immutable && yarn example ios:prebuild" | |
| - name: Build example iOS app | |
| run: nix develop .# --command bash -c "cd react-native-nitro-ark && yarn example build:ios:xcode" | |
| publish_npm_and_github_release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build_android_binaries_and_example | |
| - build_ios_binaries_and_example | |
| permissions: | |
| contents: write # Required to create a release and upload assets | |
| id-token: write # Required for npm trusted publishing | |
| steps: | |
| - name: Checkout code at tag | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.ref }} # Checkout the specific tag | |
| - name: Create directory for release assets | |
| run: mkdir -p release_assets | |
| - name: Download Android binary artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jniLibs-android-zip | |
| path: release_assets/ | |
| - name: Download iOS binary artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Ark.xcframework-zip | |
| path: release_assets/ | |
| - name: Download iOS Rust cxx bridge binary artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ArkCxxBridge.xcframework-zip | |
| path: release_assets/ | |
| - name: List downloaded artifacts | |
| run: ls -R release_assets | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| package-manager-cache: false | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies for publishing | |
| run: yarn install --immutable | |
| working-directory: react-native-nitro-ark | |
| - name: Prepare package for release | |
| run: yarn prepare | |
| working-directory: react-native-nitro-ark | |
| - name: Publish to npm | |
| run: npm publish | |
| working-directory: react-native-nitro-ark | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| VERSION="${TAG_NAME#v}" # Strip 'v' prefix if present | |
| echo "Creating GitHub release for version: $VERSION based on tag: $TAG_NAME" | |
| gh release create "$TAG_NAME" \ | |
| release_assets/jniLibs.zip \ | |
| release_assets/Ark.xcframework.zip \ | |
| release_assets/ArkCxxBridge.xcframework.zip \ | |
| --title "$TAG_NAME" \ | |
| --generate-notes |