1- name : Create Release PR
1+ name : Create Release PR (.NET only)
22
33on :
44 push :
77 workflow_dispatch :
88 inputs :
99 dotnet_version :
10- description : " .NET / Xamarin release version (e.g., 5.0.0 or 5.0.0-beta1)"
10+ description : " .NET release version (e.g., 5.0.0 or 5.0.0-beta1)"
1111 required : true
1212 type : string
1313 ios_sdk_version :
1818 description : " OneSignal Android SDK version to include (e.g., 5.1.0)"
1919 required : true
2020 type : string
21-
21+ ios_release_notes :
22+ description : " Release notes for iOS SDK"
23+ required : false
24+ type : string
25+ android_release_notes :
26+ description : " Release notes for Android SDK"
27+ required : false
28+ type : string
29+
2230jobs :
2331 create-release-pr :
24- name : Create Release PR
32+ name : Create Release PR (.NET only)
2533 runs-on : ubuntu-latest
2634
2735 steps :
3543 with :
3644 dotnet-version : ' 8.0.x'
3745
38- - name : Setup NuGet
39- uses : NuGet/setup-nuget@v2
40-
41- - name : Configure git
46+ - name : Configure Git
4247 run : |
4348 git config user.name "github-actions[bot]"
4449 git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -53,35 +58,28 @@ jobs:
5358 echo "Updating iOS SDK version reference to ${{ inputs.ios_sdk_version }}"
5459 echo "Updating Android SDK version reference to ${{ inputs.android_sdk_version }}"
5560
56- # Example: update constants, props, or metadata that reference SDK versions.
57- # Adjust these paths/patterns as appropriate for your repo structure.
58-
59- # iOS SDK version file
61+ # Update iOS SDK version in build.props or constants
6062 if grep -q "ONESIGNAL_IOS_SDK_VERSION" build.props 2>/dev/null; then
6163 sed -i "s/ONESIGNAL_IOS_SDK_VERSION = .*/ONESIGNAL_IOS_SDK_VERSION = \"${{ inputs.ios_sdk_version }}\";/" build.props
6264 fi
6365
64- # Android SDK version file
66+ # Update Android SDK version in build.props or constants
6567 if grep -q "ONESIGNAL_ANDROID_SDK_VERSION" build.props 2>/dev/null; then
6668 sed -i "s/ONESIGNAL_ANDROID_SDK_VERSION = .*/ONESIGNAL_ANDROID_SDK_VERSION = \"${{ inputs.android_sdk_version }}\";/" build.props
6769 fi
6870
69- - name : Update version numbers
71+ - name : Update .NET version number
7072 run : |
71- echo "Updating .NET and Xamarin version numbers to ${{ inputs.dotnet_version }}"
73+ echo "Updating .NET version to ${{ inputs.dotnet_version }}"
7274
73- # Xamarin version
74- sed -i "s|<version>.*</version>|<version>${{ inputs.dotnet_version }}</version>|" OneSignalSDK.Xamarin.nuspec
75-
76- # .NET version
77- sed -i "s|<version>.*</version>|<version>${{ inputs.dotnet_version }}</version>|" OneSignalSDK.DotNet.nuspec
78-
79- - name : Build Xamarin
80- run : |
81- nuget restore
82- msbuild OneSignal.sln /t:Rebuild /p:Configuration=Release /p:Version=${{ inputs.dotnet_version }} /p:ReleaseVersion=${{ inputs.dotnet_version }}
75+ # Locate and update .NET nuspec file
76+ if [ -f "OneSignalSDK.DotNet/OneSignalSDK.DotNet.nuspec" ]; then
77+ sed -i "s|<version>.*</version>|<version>${{ inputs.dotnet_version }}</version>|" OneSignalSDK.DotNet/OneSignalSDK.DotNet.nuspec
78+ else
79+ echo "⚠️ .NET nuspec not found — skipping"
80+ fi
8381
84- - name : Build .NET
82+ - name : Build .NET solution
8583 run : |
8684 dotnet restore
8785 dotnet build OneSignal.sln /t:Rebuild /p:Configuration=Release /p:Version=${{ inputs.dotnet_version }}
9088 run : |
9189 git add .
9290 git commit -m "chore(release): prepare v${{ inputs.dotnet_version }} (iOS ${{ inputs.ios_sdk_version }}, Android ${{ inputs.android_sdk_version }})"
93- git push origin HEAD
91+ git push origin HEAD || git push --force origin HEAD
9492
9593 - name : Create Release PR
9694 env :
@@ -115,5 +113,4 @@ jobs:
115113
116114 Once approved, merge into \`${TARGET_BRANCH}\` and follow manual steps to publish to NuGet." \
117115 --base "$TARGET_BRANCH" \
118- --head "rel/${{ inputs.dotnet_version }}" \
119- --label "release"
116+ --head "
0 commit comments