Skip to content
Closed
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
128 changes: 128 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Create Unity Release PR

on:
workflow_dispatch:
inputs:
bump_command:
description: "Version bump type (major, minor, patch, specify)"
required: true
type: choice
options:
- major
- minor
- patch
- specify
postfix:
description: "Optional postfix (e.g. preview, beta, or specific version when using 'specify')"
required: false
type: string

permissions:
contents: write
pull-requests: write

jobs:
compose-unity-release:
name: Compose Unity Release
runs-on: ubuntu-latest
timeout-minutes: 30

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUMP_COMMAND: ${{ github.event.inputs.bump_command }}
POSTFIX: ${{ github.event.inputs.postfix }}

steps:
- name: 📦 Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Display Configuration
run: |
echo "============================================"
echo "🎮 Unity SDK Release Composition"
echo "🧩 Bump Command: $BUMP_COMMAND"
echo "🏷️ Postfix: $POSTFIX"
echo "============================================"

- name: Prepare Environment
run: |
brew install gh jq || true
gh auth status || gh auth login --with-token <<< "$GH_TOKEN"

- name: Run composeRelease.sh
run: |
chmod +x ./composeRelease.sh
if [[ -n "$POSTFIX" ]]; then
./composeRelease.sh "$BUMP_COMMAND" "$POSTFIX" || echo "composeRelease.sh failed, continuing to patch manually"
else
./composeRelease.sh "$BUMP_COMMAND" || echo "composeRelease.sh failed, continuing to patch manually"
fi

- name: Detect New Version
id: version
run: |
VERSION=$(cat OneSignalExample/Assets/OneSignal/VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "✅ Detected new version: $VERSION"

- name: 💾 Apply Version Changes and Commit
run: |
set -e
VERSION=${{ env.VERSION }}
echo "🔧 Updating version references to $VERSION"

git fetch origin "release/$VERSION"
git checkout "release/$VERSION" || git checkout -b "release/$VERSION"

# Extract current version for replacement
CURRENT=$(grep -Eo '[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?' OneSignalExample/Assets/OneSignal/VERSION | head -n 1)
echo "Detected previous version: $CURRENT"

# 1️⃣ Update OneSignal.cs
sed -i '' "s/Version = \".*\";/Version = \"$VERSION\";/" com.onesignal.unity.core/Runtime/OneSignal.cs

# 2️⃣ Update OneSignalPlatform.cs header
OLD_HEADER=$(printf "%02d%02d%02d" $(echo $CURRENT | tr '.' ' '))
NEW_HEADER=$(printf "%02d%02d%02d" $(echo $VERSION | tr '.' ' '))
sed -i '' "s/VersionHeader = \".*\";/VersionHeader = \"$NEW_HEADER\";/" com.onesignal.unity.core/Runtime/OneSignalPlatform.cs

# 3️⃣ Update UIApplication+OneSignalUnity.mm iOS header
sed -i '' "s/setSdkVersion:@\".*\"];$/setSdkVersion:@\"$NEW_HEADER\"];/" com.onesignal.unity.ios/Runtime/Plugins/iOS/UIApplication+OneSignalUnity.mm

# 4️⃣ Update all package.json versions
find . -path "*/package.json" -exec sed -i '' "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" {} \;
find . -path "*/package.json" -exec sed -i '' "s/\"com.onesignal.unity.core\": \".*\"/\"com.onesignal.unity.core\": \"$VERSION\"/" {} \;

# 5️⃣ Update packages-lock.json
sed -i '' "s/\"com.onesignal.unity.core\": \".*\"/\"com.onesignal.unity.core\": \"$VERSION\"/" OneSignalExample/Packages/packages-lock.json

# 6️⃣ Update .asmdef version expressions
find OneSignalExample/Assets/OneSignal -name "*.asmdef" -exec sed -i '' "s/\"expression\": \".*\"/\"expression\": \"$VERSION\"/" {} \;

# 7️⃣ Update CHANGELOG.md section
CHANGELOG="OneSignalExample/Assets/OneSignal/CHANGELOG.md"
if grep -q "\[Unreleased\]" "$CHANGELOG"; then
sed -i '' "s/## \[Unreleased\]/## [Unreleased]\n## [$VERSION]/" "$CHANGELOG"
fi

echo "✅ Version updates applied."

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git add .
git commit -m "chore(release): update version files for $VERSION" || echo "No changes to commit"
git push origin "release/$VERSION"

- name: 🔍 Confirm PR Exists
run: |
PR_URL=$(gh pr list --head "release/$VERSION" --json url --jq '.[0].url')
if [[ -n "$PR_URL" ]]; then
echo "✅ Release PR found: $PR_URL"
else
echo "⚠️ No PR found. composeRelease.sh should have created one."
echo "If missing, create manually from release/$VERSION → main."
fi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.1.15",
"expression": "5.1.16",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Expand Down
4 changes: 3 additions & 1 deletion OneSignalExample/Assets/OneSignal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [5.1.16]
## [5.1.15]
### Changed
- Updated included Android SDK from 5.1.31 to [5.1.37](https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/5.1.37)
Expand Down Expand Up @@ -483,7 +484,8 @@ If you run into any problems, please don’t hesitate to [open an issue](https:/
- If you are updating from a previous version of the OneSignal Unity SDK please follow the Unity Asset Store instructions in
the [README](https://github.com/OneSignal/OneSignal-Unity-SDK/README.md#unity-asset-store) to ensure a smooth transition.

[Unreleased]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/5.1.15...HEAD
[Unreleased]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/5.1.16...HEAD
[5.1.16]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/5.1.15...5.1.16
[5.1.15]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/5.1.14...5.1.15
[5.1.14]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/5.1.13...5.1.14
[5.1.13]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/5.1.12...5.1.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.1.15",
"expression": "5.1.16",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.1.15",
"expression": "5.1.16",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Expand Down
2 changes: 1 addition & 1 deletion OneSignalExample/Assets/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.15
5.1.16
14 changes: 7 additions & 7 deletions OneSignalExample/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.onesignal.unity.core": "5.1.15"
"com.onesignal.unity.core": "5.1.16"
}
},
"com.onesignal.unity.core": {
Expand All @@ -19,11 +19,11 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.onesignal.unity.core": "5.1.15"
"com.onesignal.unity.core": "5.1.16"
}
},
"com.unity.ai.navigation": {
"version": "1.1.5",
"version": "1.1.4",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -45,7 +45,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.35",
"version": "3.0.24",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -54,7 +54,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.22",
"version": "2.0.18",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -97,7 +97,7 @@
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.7",
"version": "3.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -106,7 +106,7 @@
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.7.7",
"version": "1.7.5",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
16 changes: 3 additions & 13 deletions OneSignalExample/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ PlayerSettings:
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
unsupportedMSAAFallback: 0
m_SpriteBatchVertexThreshold: 300
m_MTRendering: 1
mipStripping: 0
Expand Down Expand Up @@ -76,16 +75,13 @@ PlayerSettings:
androidMinimumWindowWidth: 400
androidMinimumWindowHeight: 300
androidFullscreenMode: 1
androidAutoRotationBehavior: 1
androidPredictiveBackSupport: 0
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 1
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
Force IOS Speakers When Recording: 0
audioSpatialExperience: 0
deferSystemGesturesMode: 0
hideHomeButton: 0
submitAnalytics: 1
Expand Down Expand Up @@ -139,9 +135,7 @@ PlayerSettings:
vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1
loadStoreDebugModeEnabled: 0
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 5.1.15
bundleVersion: 5.1.16
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand All @@ -153,7 +147,6 @@ PlayerSettings:
isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0
enableOpenGLProfilerGPURecorders: 1
allowHDRDisplaySupport: 0
useHDRDisplay: 0
hdrBitDepth: 0
m_ColorGamuts: 00000000
Expand Down Expand Up @@ -188,10 +181,8 @@ PlayerSettings:
strictShaderVariantMatching: 0
VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988
iOSSimulatorArchitecture: 0
iOSTargetOSVersionString: 12.0
tvOSSdkVersion: 0
tvOSSimulatorArchitecture: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 12.0
VisionOSSdkVersion: 0
Expand Down Expand Up @@ -238,7 +229,6 @@ PlayerSettings:
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
metalCompileShaderBinary: 0
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
Expand Down Expand Up @@ -523,6 +513,7 @@ PlayerSettings:
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchEnableFileSystemTrace: 0
switchUseGOLDLinker: 0
switchLTOSetting: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
Expand Down Expand Up @@ -652,7 +643,7 @@ PlayerSettings:
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchDisableHTCSPlayerConnection: 0
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0
switchUseLegacyFmodPriorities: 0
switchUseMicroSleepForYield: 1
Expand Down Expand Up @@ -823,7 +814,6 @@ PlayerSettings:
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenUseBackgroundColor: 0
syncCapabilities: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}
metroFTAName:
Expand Down
4 changes: 2 additions & 2 deletions com.onesignal.unity.android/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.onesignal.unity.android",
"displayName": "OneSignal Unity SDK - Android",
"version": "5.1.15",
"version": "5.1.16",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
"com.onesignal.unity.core": "5.1.15"
"com.onesignal.unity.core": "5.1.16"
},
"keywords": [
"push-notifications",
Expand Down
2 changes: 1 addition & 1 deletion com.onesignal.unity.core/Runtime/OneSignal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace OneSignalSDK
/// </summary>
public static partial class OneSignal
{
public const string Version = "5.1.15";
public const string Version = "5.1.16";

/// <summary>
/// The default static instance of the OneSignal Unity SDK
Expand Down
2 changes: 1 addition & 1 deletion com.onesignal.unity.core/Runtime/OneSignalPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace OneSignalSDK
{
public abstract class OneSignalPlatform
{
public const string VersionHeader = "050115";
public const string VersionHeader = "050116";

internal static event Action<string> OnInitialize;

Expand Down
2 changes: 1 addition & 1 deletion com.onesignal.unity.core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.onesignal.unity.core",
"displayName": "OneSignal Unity SDK - Core",
"version": "5.1.15",
"version": "5.1.16",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ - (void)setOneSignalUnityDelegate:(id <UIApplicationDelegate>)delegate {

- (BOOL)oneSignalApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[OneSignalWrapper setSdkType:@"unity"];
[OneSignalWrapper setSdkVersion:@"050115"];
[OneSignalWrapper setSdkVersion:@"050116"];
[OneSignal initialize:nil withLaunchOptions:launchOptions];

if ([self respondsToSelector:@selector(oneSignalApplication:didFinishLaunchingWithOptions:)])
Expand Down
4 changes: 2 additions & 2 deletions com.onesignal.unity.ios/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.onesignal.unity.ios",
"displayName": "OneSignal Unity SDK - iOS",
"version": "5.1.15",
"version": "5.1.16",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
"com.onesignal.unity.core": "5.1.15"
"com.onesignal.unity.core": "5.1.16"
},
"keywords": [
"push-notifications",
Expand Down
Loading