Skip to content
Merged
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
37 changes: 17 additions & 20 deletions .github/actions/setup-demo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,33 @@ inputs:
runs:
using: 'composite'
steps:
- name: Set up Bun
uses: oven-sh/setup-bun@v2

- name: Cache SDK bun dependencies
uses: actions/cache@v5
- name: Set up Vite+
uses: voidzero-dev/setup-vp@v1
with:
path: node_modules
key: bun-sdk-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-sdk-${{ runner.os }}-
cache: true
run-install: true

- name: Cache demo bun dependencies
- name: Cache demo Vite+ dependencies
uses: actions/cache@v5
with:
path: examples/demo/node_modules
key: bun-demo-${{ runner.os }}-${{ hashFiles('examples/demo/bun.lock') }}
restore-keys: bun-demo-${{ runner.os }}-

- name: Install SDK dependencies
shell: bash
run: bun install --frozen-lockfile

- name: Set up demo
shell: bash
working-directory: examples/demo
run: bun run setup
key: vp-demo-${{ runner.os }}-${{ hashFiles('examples/demo/bun.lock') }}
restore-keys: vp-demo-${{ runner.os }}-

# Must precede `vp run setup`: the demo's setup.sh runs `vp run build`,
# which inlines `import.meta.env.VITE_*` into the web bundle at build time.
# Writing .env afterward leaves the bundle (and therefore the APK/IPA) with
# fallback values like the default APP_ID.
- name: Create demo .env
shell: bash
working-directory: examples/demo
run: |
echo "VITE_ONESIGNAL_APP_ID=${{ inputs.onesignal-app-id }}" > .env
echo "VITE_ONESIGNAL_API_KEY=${{ inputs.onesignal-api-key }}" >> .env
echo "VITE_ONESIGNAL_ANDROID_CHANNEL_ID=7ec2ece9-c538-4656-9516-1316f48a005c" >> .env
echo "VITE_E2E_MODE=true" >> .env

- name: Install and set up demo
shell: bash
working-directory: examples/demo
run: vp run setup
1 change: 0 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ jobs:
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
with:
branch: ${{ github.event.pull_request.base.ref }}
toolchain: vite-plus
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ concurrency:
jobs:
call:
uses: OneSignal/sdk-shared/.github/workflows/wrapper-js-ci.yml@main
with:
toolchain: vite-plus
19 changes: 15 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,22 @@ jobs:
onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }}
onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }}

- name: Build release APK
- name: Build debug APK
working-directory: examples/demo/android
run: ./gradlew assembleRelease --quiet --console=plain --warning-mode=summary
# Use the debug variant: Capacitor only calls
# WebView.setWebContentsDebuggingEnabled(true) when BuildConfig.DEBUG
# is true, which Appium needs to enter the WEBVIEW context (CSS /
# data-testid selectors). Release APKs error with
# "Failed to get sockets matching: @webview_devtools_remote_.*".
# -PciSingleAbi → arm64-v8a-only APK; BrowserStack devices are all
# arm64-v8a, so dropping other ABIs trims size with no test impact.
run: ./gradlew assembleDebug -PciSingleAbi --quiet --console=plain --warning-mode=summary

- name: Upload APK
uses: actions/upload-artifact@v7
with:
name: demo-apk
path: examples/demo/android/app/build/outputs/apk/release/app-release.apk
path: examples/demo/android/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
retention-days: 1
compression-level: 0

Expand Down Expand Up @@ -92,6 +99,10 @@ jobs:

- name: Build signed IPA
working-directory: examples/demo/ios/App
# Release builds are fine for Appium because capacitor.config.ts sets
# `ios.webContentsDebuggingEnabled: true`, which forces
# WKWebView.isInspectable=true so the WEBVIEW_* context (and
# data-testid selectors) remain available in Release IPAs.
run: |
xcodebuild archive \
-project App.xcodeproj \
Expand Down Expand Up @@ -138,7 +149,7 @@ jobs:
with:
platform: android
app-artifact: demo-apk
app-filename: app-release.apk
app-filename: app-arm64-v8a-debug.apk
sdk-type: capacitor
build-name: capacitor-android-${{ github.ref_name }}-${{ github.run_number }}

Expand Down
2 changes: 1 addition & 1 deletion OneSignalCapacitorPlugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.swift_version = '5.9'

s.dependency 'Capacitor'
s.dependency 'OneSignalXCFramework', '5.5.0'
s.dependency 'OneSignalXCFramework', '5.5.1'
end
2 changes: 1 addition & 1 deletion android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ compileSdk = "35"
junit = "4.13.2"
kotlin = "1.9.25"
minSdk = "23"
onesignal = "5.7.7"
onesignal = "5.8.1"
targetSdk = "35"

[libraries]
Expand Down
17 changes: 17 additions & 0 deletions examples/demo/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ android {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
// Sign release with Android's auto-generated debug keystore so
// `assembleRelease` produces an installable app-release.apk for
// Appium E2E. Don't ship release builds to users this way.
signingConfig = signingConfigs.getByName("debug")
}
}

// Opt-in via `-PciSingleAbi` to build an arm64-v8a-only APK for CI.
// BrowserStack devices we test against are all arm64-v8a, so dropping
// the other ABIs trims native libraries (Capacitor WebView shims and
// plugin .so files) without affecting test coverage.
splits {
abi {
isEnable = project.hasProperty("ciSingleAbi")
reset()
include("arm64-v8a")
isUniversalApk = false
}
}
}
Expand Down
Loading
Loading