Skip to content
Open
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
27 changes: 21 additions & 6 deletions .github/workflows/publish-npm-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
JSON array of package scopes/names to publish (e.g., '["com.onesignal.unity.core", "com.onesignal.unity.android"]')
If empty, publishes the root package.json
default: "[]"
toolchain:
required: false
type: string
description: Toolchain to use for install & build ("bun" or "vite-plus")
default: bun
secrets:
GH_PUSH_TOKEN:
required: false
Expand All @@ -39,19 +44,29 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.branch }}

# Bun for installing dependencies and building
- name: Setup Bun
if: inputs.toolchain == 'bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install & Build
- name: Setup Vite+
if: inputs.toolchain == 'vite-plus'
uses: voidzero-dev/setup-vp@v1
with:
cache: yes
run-install: true

- name: Install & Build (Bun)
if: inputs.toolchain == 'bun'
run: |
bun install --frozen-lockfile
bun run build

# Can't use Bun yet for publishing to NPM via OIDC, so we use Node.js
# for publishing
- name: Build (Vite+)
if: inputs.toolchain == 'vite-plus'
run: vp pack

- name: Setup Node
uses: actions/setup-node@v6
with:
Expand All @@ -61,8 +76,8 @@ jobs:
- name: Get version
id: get_version
run: |
CURRENT_VERSION=$(bun -e "console.log(require('./package.json').version)")
PACKAGE_NAME=$(bun -e "console.log(require('./package.json').name)")
CURRENT_VERSION=$(node -e "console.log(require('./package.json').version)")
PACKAGE_NAME=$(node -e "console.log(require('./package.json').name)")
if git rev-parse "$CURRENT_VERSION" >/dev/null 2>&1; then
echo "Tag $CURRENT_VERSION already exists, nothing to do"
exit 0
Expand Down
38 changes: 31 additions & 7 deletions .github/workflows/wrapper-js-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CI workflow for JavaScript-based wrapper SDKs (Cordova-Ionic/React Native)
# Sets up JDK, Homebrew, Clang, Bun, then runs lint and tests
# Sets up JDK, Clang, and either Bun or Vite+ (vp), then runs lint and tests
name: Wrapper JS CI

on:
Expand All @@ -10,20 +10,25 @@ on:
type: string
description: Java version to use
default: "17"
toolchain:
required: false
type: string
description: Toolchain to use for install, lint & test ("bun" or "vite-plus")
default: bun
bun_version:
required: false
type: string
description: Bun version to use
description: Bun version to use (only when toolchain is "bun")
default: latest

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java_version }}
Expand All @@ -33,15 +38,34 @@ jobs:
uses: OneSignal/actions/.github/actions/setup-clang@main

- name: Set up Bun
if: inputs.toolchain == 'bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ inputs.bun_version }}

- name: Install
- name: Install (Bun)
if: inputs.toolchain == 'bun'
run: bun install --frozen-lockfile

- name: Linting
- name: Set up Vite+
if: inputs.toolchain == 'vite-plus'
uses: voidzero-dev/setup-vp@v1
with:
cache: yes
run-install: true

- name: Linting (Bun)
if: inputs.toolchain == 'bun'
run: bun run lint

- name: Tests
- name: Linting (Vite+)
if: inputs.toolchain == 'vite-plus'
run: vp run lint

- name: Tests (Bun)
if: inputs.toolchain == 'bun'
run: bun run test:coverage

- name: Tests (Vite+)
if: inputs.toolchain == 'vite-plus'
run: vp run test
Loading