From 2247b2d7c99cbd8c6c9675ca5a2a6d47333a03d6 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 19 Mar 2026 15:57:06 -0700 Subject: [PATCH 1/5] ci: add reusable Vite+ wrapper SDK workflow --- .github/workflows/wrapper-vp-ci.yml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/wrapper-vp-ci.yml diff --git a/.github/workflows/wrapper-vp-ci.yml b/.github/workflows/wrapper-vp-ci.yml new file mode 100644 index 0000000..05a9507 --- /dev/null +++ b/.github/workflows/wrapper-vp-ci.yml @@ -0,0 +1,40 @@ +# CI workflow for Vite+-based wrapper SDKs +# Sets up JDK, Clang, Vite+ (vp), then runs lint and tests +name: Wrapper VP CI + +on: + workflow_call: + inputs: + java_version: + required: false + type: string + description: Java version to use + default: "17" + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: ${{ inputs.java_version }} + distribution: "temurin" + + - name: Setup Clang + uses: OneSignal/actions/.github/actions/setup-clang@main + + - name: Set up Vite+ + uses: voidzero-dev/setup-vp@v1 + + - name: Install + run: vp install --frozen-lockfile + + - name: Linting + run: vp run lint + + - name: Tests + run: vp run test:coverage From 62b9d4047081e6efc5baa8c35b0198f7347899cd Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 19 Mar 2026 15:59:55 -0700 Subject: [PATCH 2/5] ci(workflow): optimize Vite+ wrapper workflow setup --- .github/workflows/wrapper-vp-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wrapper-vp-ci.yml b/.github/workflows/wrapper-vp-ci.yml index 05a9507..4d12272 100644 --- a/.github/workflows/wrapper-vp-ci.yml +++ b/.github/workflows/wrapper-vp-ci.yml @@ -29,12 +29,12 @@ jobs: - name: Set up Vite+ uses: voidzero-dev/setup-vp@v1 - - - name: Install - run: vp install --frozen-lockfile + with: + cache: yes + run-install: true - name: Linting run: vp run lint - name: Tests - run: vp run test:coverage + run: vp run test From 83aedf9975c4e3a89b3229fe250d6231fa997284 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 19 Mar 2026 17:53:02 -0700 Subject: [PATCH 3/5] ci(workflow): add Vite+ runtime support to npm publish --- .github/workflows/publish-npm-github.yml | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-npm-github.yml b/.github/workflows/publish-npm-github.yml index dac495b..e097ac1 100644 --- a/.github/workflows/publish-npm-github.yml +++ b/.github/workflows/publish-npm-github.yml @@ -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: "[]" + runtime: + required: false + type: string + description: Runtime to use for install & build ("bun" or "vp") + default: bun secrets: GH_PUSH_TOKEN: required: false @@ -39,19 +44,29 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ inputs.branch }} - # Bun for installing dependencies and building - name: Setup Bun + if: inputs.runtime == 'bun' uses: oven-sh/setup-bun@v2 with: bun-version: latest - - name: Install & Build + - name: Setup Vite+ + if: inputs.runtime == 'vp' + uses: voidzero-dev/setup-vp@v1 + with: + cache: yes + run-install: true + + - name: Install & Build (Bun) + if: inputs.runtime == '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.runtime == 'vp' + run: vp pack + - name: Setup Node uses: actions/setup-node@v6 with: @@ -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 From a5658d6ea0114bf6928278c502138448548a04ed Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 19 Mar 2026 17:53:55 -0700 Subject: [PATCH 4/5] ci(workflow): merge JS and VP workflows with runtime param --- .github/workflows/wrapper-js-ci.yml | 28 +++++++++++++++----- .github/workflows/wrapper-vp-ci.yml | 40 ----------------------------- 2 files changed, 21 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/wrapper-vp-ci.yml diff --git a/.github/workflows/wrapper-js-ci.yml b/.github/workflows/wrapper-js-ci.yml index 935150f..947e0ee 100644 --- a/.github/workflows/wrapper-js-ci.yml +++ b/.github/workflows/wrapper-js-ci.yml @@ -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: @@ -10,10 +10,15 @@ on: type: string description: Java version to use default: "17" + runtime: + required: false + type: string + description: Runtime to use for install, lint & test ("bun" or "vp") + default: bun bun_version: required: false type: string - description: Bun version to use + description: Bun version to use (only when runtime is "bun") default: latest jobs: @@ -21,9 +26,9 @@ jobs: 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 }} @@ -33,15 +38,24 @@ jobs: uses: OneSignal/actions/.github/actions/setup-clang@main - name: Set up Bun + if: inputs.runtime == 'bun' uses: oven-sh/setup-bun@v2 with: bun-version: ${{ inputs.bun_version }} - - name: Install + - name: Install (Bun) + if: inputs.runtime == 'bun' run: bun install --frozen-lockfile + - name: Set up Vite+ + if: inputs.runtime == 'vp' + uses: voidzero-dev/setup-vp@v1 + with: + cache: yes + run-install: true + - name: Linting - run: bun run lint + run: ${{ inputs.runtime == 'vp' && 'vp' || 'bun' }} run lint - name: Tests - run: bun run test:coverage + run: ${{ inputs.runtime == 'vp' && 'vp' || 'bun' }} run test${{ inputs.runtime == 'bun' && ':coverage' || '' }} diff --git a/.github/workflows/wrapper-vp-ci.yml b/.github/workflows/wrapper-vp-ci.yml deleted file mode 100644 index 4d12272..0000000 --- a/.github/workflows/wrapper-vp-ci.yml +++ /dev/null @@ -1,40 +0,0 @@ -# CI workflow for Vite+-based wrapper SDKs -# Sets up JDK, Clang, Vite+ (vp), then runs lint and tests -name: Wrapper VP CI - -on: - workflow_call: - inputs: - java_version: - required: false - type: string - description: Java version to use - default: "17" - -jobs: - ci: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.java_version }} - distribution: "temurin" - - - name: Setup Clang - uses: OneSignal/actions/.github/actions/setup-clang@main - - - name: Set up Vite+ - uses: voidzero-dev/setup-vp@v1 - with: - cache: yes - run-install: true - - - name: Linting - run: vp run lint - - - name: Tests - run: vp run test From aa2abb12016e58f97ae05a2fb0c45be6a57874f0 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 19 Mar 2026 17:55:31 -0700 Subject: [PATCH 5/5] ci(workflow): split runtime steps for clarity --- .github/workflows/publish-npm-github.yml | 12 +++++----- .github/workflows/wrapper-js-ci.yml | 30 ++++++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish-npm-github.yml b/.github/workflows/publish-npm-github.yml index e097ac1..8e6371f 100644 --- a/.github/workflows/publish-npm-github.yml +++ b/.github/workflows/publish-npm-github.yml @@ -16,10 +16,10 @@ 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: "[]" - runtime: + toolchain: required: false type: string - description: Runtime to use for install & build ("bun" or "vp") + description: Toolchain to use for install & build ("bun" or "vite-plus") default: bun secrets: GH_PUSH_TOKEN: @@ -45,26 +45,26 @@ jobs: ref: ${{ inputs.branch }} - name: Setup Bun - if: inputs.runtime == 'bun' + if: inputs.toolchain == 'bun' uses: oven-sh/setup-bun@v2 with: bun-version: latest - name: Setup Vite+ - if: inputs.runtime == 'vp' + if: inputs.toolchain == 'vite-plus' uses: voidzero-dev/setup-vp@v1 with: cache: yes run-install: true - name: Install & Build (Bun) - if: inputs.runtime == 'bun' + if: inputs.toolchain == 'bun' run: | bun install --frozen-lockfile bun run build - name: Build (Vite+) - if: inputs.runtime == 'vp' + if: inputs.toolchain == 'vite-plus' run: vp pack - name: Setup Node diff --git a/.github/workflows/wrapper-js-ci.yml b/.github/workflows/wrapper-js-ci.yml index 947e0ee..7cfe231 100644 --- a/.github/workflows/wrapper-js-ci.yml +++ b/.github/workflows/wrapper-js-ci.yml @@ -10,15 +10,15 @@ on: type: string description: Java version to use default: "17" - runtime: + toolchain: required: false type: string - description: Runtime to use for install, lint & test ("bun" or "vp") + 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 (only when runtime is "bun") + description: Bun version to use (only when toolchain is "bun") default: latest jobs: @@ -38,24 +38,34 @@ jobs: uses: OneSignal/actions/.github/actions/setup-clang@main - name: Set up Bun - if: inputs.runtime == 'bun' + if: inputs.toolchain == 'bun' uses: oven-sh/setup-bun@v2 with: bun-version: ${{ inputs.bun_version }} - name: Install (Bun) - if: inputs.runtime == 'bun' + if: inputs.toolchain == 'bun' run: bun install --frozen-lockfile - name: Set up Vite+ - if: inputs.runtime == 'vp' + if: inputs.toolchain == 'vite-plus' uses: voidzero-dev/setup-vp@v1 with: cache: yes run-install: true - - name: Linting - run: ${{ inputs.runtime == 'vp' && 'vp' || 'bun' }} run lint + - name: Linting (Bun) + if: inputs.toolchain == 'bun' + run: bun run lint - - name: Tests - run: ${{ inputs.runtime == 'vp' && 'vp' || 'bun' }} run test${{ inputs.runtime == 'bun' && ':coverage' || '' }} + - 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