Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FISHJAM_ID=
FISHJAM_SDK_API_URL=
2 changes: 1 addition & 1 deletion .github/workflows/mobile_eas_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: corepack enable

- name: 📦 Install dependencies
run: yarn && yarn build
run: yarn && yarn build:non-native

- name: 🚀 Build app
run: eas build --non-interactive --platform=all --profile production
Expand Down
133 changes: 129 additions & 4 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ jobs:
run: yarn --immutable

- name: Build 📦
run: yarn build
run: yarn build:non-native

- name: Test 🧑‍🔬
run: yarn test:unit
run: yarn test:unit:non-native

- name: Check formatting 🎨
run: yarn format:check
run: yarn format:check:non-native

- name: Run linter 👮
run: yarn lint:check
run: yarn lint:check:non-native

- name: Run typecheck 🚓
run: yarn tsc
Expand All @@ -53,3 +53,128 @@ jobs:

- name: Spellcheck
run: yarn spellcheck

android:
name: Android client and example
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node 🛎️
uses: actions/setup-node@v4
with:
node-version: 24.4.1
cache: "npm"

- name: Use corepack
run: corepack enable

- name: Install dependencies ⬇️
run: yarn --immutable

- name: Use Java 17 ☕
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Use Gradle 🐘
uses: gradle/actions/setup-gradle@v4

- name: Install Rust Android targets 🦀
run: rustup target add aarch64-linux-android x86_64-linux-android

- name: Install cargo-ndk 🦀
run: cargo install cargo-ndk --version 4.1.2 --locked

# The example reads FISHJAM_ID and FISHJAM_SDK_API_URL from .env at build time.
- name: Write placeholder .env 🔑
run: printf 'FISHJAM_ID=https://example.com/api/v1/connect/ci\nFISHJAM_SDK_API_URL=https://example.com/room-manager\n' > .env

- name: Build 📦
run: |
yarn workspace @fishjam-cloud/android-client build
yarn workspace @fishjam-example/android-client build

- name: Check formatting 🎨
run: |
yarn workspace @fishjam-cloud/android-client format:check
yarn workspace @fishjam-example/android-client format:check

- name: Run linter 👮
run: |
yarn workspace @fishjam-cloud/android-client lint:check
yarn workspace @fishjam-example/android-client lint:check

- name: Enable KVM for the emulator
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Test 🧑‍🔬
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
target: google_apis
script: yarn workspace @fishjam-cloud/android-client test

ios:
name: iOS client and example
runs-on: macos-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node 🛎️
uses: actions/setup-node@v4
with:
node-version: 24.4.1
cache: "npm"

- name: Use corepack
run: corepack enable

- name: Install dependencies ⬇️
run: yarn --immutable

- name: Use latest Xcode 🔨
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Install xcodegen, SwiftLint and protoc 🍺
run: brew install xcodegen swiftlint protobuf swift-protobuf

- name: Install Rust iOS targets 🦀
run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim

# The example reads FISHJAM_ID and FISHJAM_SDK_API_URL from .env at build time.
- name: Write placeholder .env 🔑
run: printf 'FISHJAM_ID=https://example.com/api/v1/connect/ci\nFISHJAM_SDK_API_URL=https://example.com/room-manager\n' > .env

- name: Build 📦
run: |
yarn workspace @fishjam-cloud/ios-client build
yarn workspace @fishjam-example/ios-client build

- name: Test 🧑‍🔬
run: yarn workspace @fishjam-cloud/ios-client test

- name: Check formatting 🎨
run: |
yarn workspace @fishjam-cloud/ios-client format:check
yarn workspace @fishjam-example/ios-client format:check

- name: Run linter 👮
run: |
yarn workspace @fishjam-cloud/ios-client lint:check
yarn workspace @fishjam-example/ios-client lint:check
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: corepack enable
- run: yarn
- run: yarn build
- run: yarn build:non-native
- run: yarn pack --out package.tgz
working-directory: packages/webrtc-client
- run: npm publish package.tgz --provenance --access public ${{ github.event.release.prerelease && '--tag rc' || '' }}
Expand All @@ -41,7 +41,7 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: corepack enable
- run: yarn
- run: yarn build
- run: yarn build:non-native
- run: yarn pack --out package.tgz
working-directory: packages/ts-client
- run: npm publish package.tgz --provenance --access public ${{ github.event.release.prerelease && '--tag rc' || '' }}
Expand All @@ -63,7 +63,7 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: corepack enable
- run: yarn
- run: yarn build
- run: yarn build:non-native
- run: yarn pack --out package.tgz
working-directory: packages/react-client
- run: npm publish package.tgz --provenance --access public ${{ github.event.release.prerelease && '--tag rc' || '' }}
Expand All @@ -86,7 +86,7 @@ jobs:
- run: corepack enable
- run: yarn
- run: yarn workspace @fishjam-cloud/react-native-client run check:webrtc-published
- run: yarn build
- run: yarn build:non-native
- run: yarn pack --out package.tgz
working-directory: packages/mobile-client
- run: npm publish package.tgz --provenance --access public ${{ github.event.release.prerelease && '--tag rc' || '' }}
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
- run: corepack enable
- run: yarn
- run: yarn workspace @fishjam-cloud/react-native-custom-video-source run check:webrtc-published
- run: yarn build
- run: yarn build:non-native
- run: yarn pack --out package.tgz
working-directory: packages/react-native-custom-video-source
- run: npm publish package.tgz --provenance --access public ${{ github.event.release.prerelease && '--tag rc' || '' }}
Expand All @@ -158,7 +158,7 @@ jobs:
- run: corepack enable
- run: yarn
- run: yarn workspace @fishjam-cloud/react-native-vision-camera-source run check:webrtc-published
- run: yarn build
- run: yarn build:non-native
- run: yarn pack --out package.tgz
working-directory: packages/react-native-vision-camera-source
- run: npm publish package.tgz --provenance --access public ${{ github.event.release.prerelease && '--tag rc' || '' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
run: yarn --immutable

- name: Build 📦
run: yarn build
run: yarn build:non-native

- name: Run unit tests 🧪
run: yarn test:unit
run: yarn test:unit:non-native

- name: Install Playwright Browsers 🧭
run: npx playwright install --with-deps
Expand Down
7 changes: 7 additions & 0 deletions examples/android-client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*.{kt,kts}]
indent_size = 4
max_line_length = 120
ktlint_code_style = android_studio
ktlint_function_naming_ignore_when_annotated_with = Composable
8 changes: 8 additions & 0 deletions examples/android-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gradle/
build/
local.properties
*.iml
.idea/
captures/
.cxx/
.kotlin/
91 changes: 91 additions & 0 deletions examples/android-client/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import java.io.File

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ktlint)
}

fun loadDotEnv(file: File): Map<String, String> {
if (!file.exists()) {
throw GradleException("Missing ${file.path}. Copy .env.example to .env.")
}
return file.readLines().mapNotNull { raw ->
val line = raw.substringBefore("#").trim()
if (line.isEmpty() || !line.contains("=")) {
return@mapNotNull null
}
val key = line.substringBefore("=").trim()
val value = line.substringAfter("=").trim().removeSurrounding("\"")
key to value
}.toMap()
}

fun fishjamEnvValue(name: String): String {
val value = fishjamEnv[name]?.takeIf { it.isNotEmpty() }
?: throw GradleException("$name is missing from .env")
val escaped = value.replace("\\", "\\\\").replace("\"", "\\\"")
return "\"$escaped\""
}

val fishjamEnv = loadDotEnv(rootProject.file("../../.env"))

android {
namespace = "io.fishjam.example"
compileSdk = 35

defaultConfig {
applicationId = "io.fishjam.example"
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "FISHJAM_ID", fishjamEnvValue("FISHJAM_ID"))
buildConfigField(
"String",
"FISHJAM_SDK_API_URL",
fishjamEnvValue("FISHJAM_SDK_API_URL")
)
}

buildFeatures {
compose = true
buildConfig = true
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}

ktlint {
android.set(true)
outputToConsole.set(true)
ignoreFailures.set(false)
}

dependencies {
implementation(project(":client"))

implementation(platform(libs.compose.bom))
implementation(libs.compose.ui)
implementation(libs.compose.foundation)
implementation(libs.compose.material3)
implementation(libs.activity.compose)
implementation(libs.coroutines.android)

androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.compose.ui.test.junit4)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.test.runner)
debugImplementation(libs.compose.ui.test.manifest)
}
18 changes: 18 additions & 0 deletions examples/android-client/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Fishjam Example"
android:theme="@android:style/Theme.Material.Light.NoActionBar">
<activity
android:name=".MainActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading
Loading