Skip to content

Create Release PR

Create Release PR #26

name: Create Release PR
on:
push:
branches:
- "ci-create-release-pr"
# For making a release pr from android / ios sdk actions
workflow_call:
inputs:
dotnet_version:
description: 'New .NET Version (e.g., 5.2.15 or 5.2.15-beta.1)'
required: true
type: string
android_version:
description: 'New Android SDK Version (e.g., 2.3.0). Leave blank to skip.'
required: false
type: string
ios_version:
description: 'New iOS SDK Version (e.g., 1.5.0). Leave blank to skip.'
required: false
type: string
# For making a release pr from .NET github actions
workflow_dispatch:
inputs:
dotnet_version:
description: ".NET release version (e.g., 5.0.0 or 5.0.0-beta1)"
required: true
type: string
android_version:
description: "ONew Android SDK Version (e.g., 2.3.0). Leave blank to skip."
required: false
type: string
ios_version:
description: "New iOS SDK Version (e.g., 1.5.0). Leave blank to skip."
required: false
type: string
jobs:
prep:
uses: OneSignal/sdk-actions/.github/workflows/prep-release.yml@main
with:
version: ${{ inputs.dotnet_version }}
# DOTNET specific steps
update-version:
name: Create Release PR
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Force .NET 8 SDK pinning
run: |
# Find the newest installed 8.x SDK version
SDK_VERSION=$(dotnet --list-sdks | awk '/^8\./ {print $1}' | sort -Vr | head -n 1)
cat <<EOF > global.json
{
"sdk": {
"version": "$SDK_VERSION",
"rollForward": "latestFeature"
}
}
EOF
- name: Confirm SDK version
run: dotnet --info
- name: Install required .NET workloads
run: |
dotnet workload restore || true
dotnet workload install android ios wasm-tools --skip-manifest-update
- name: Clone and update native SDKs
run: |
echo "Cloning native SDKs..."
cd ..
git clone https://github.com/OneSignal/OneSignal-iOS-SDK.git
cd OneSignal-iOS-SDK && git checkout ${{ inputs.ios_version }} && cd ../OneSignal-DotNet-SDK
echo "Running update_native_binaries.sh..."
chmod +x ./update_native_binaries.sh
./update_native_binaries.sh \
--android_native_version=${{ inputs.android_version }}
- name: Update .NET version in nuspec
run: |
VERSION=${{ inputs.dotnet_version }}
echo "🔧 Updating .NET SDK version to $VERSION"
sed -i '' "s|<version>.*</version>|<version>${VERSION}</version>|" OneSignalSDK.DotNet.nuspec
echo "✅ Updated OneSignalSDK.DotNet.nuspec"
- name: Ensure Android SDK platform 33 is installed
run: |
echo "Installing Android SDK Platform 33..."
yes | sdkmanager --licenses
sdkmanager "platforms;android-33" "platform-tools" "build-tools;33.0.2"
- name: Build .NET solution
run: |
dotnet restore
dotnet build OneSignal.sln /t:Rebuild /p:Configuration=Release /p:Version=${{ inputs.dotnet_version }}