Create Release PR #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Cache .NET workloads | |
| id: dotnet-workload-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.dotnet | |
| ~/.nuget/packages | |
| key: dotnet-workloads-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| dotnet-workloads-${{ runner.os }}- | |
| - name: Install required .NET workloads | |
| run: | | |
| dotnet workload install android ios wasm-tools | |
| - 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: Build .NET solution | |
| run: | | |
| dotnet restore | |
| dotnet build OneSignal.sln /t:Rebuild /p:Configuration=Release /p:Version=${{ inputs.dotnet_version }} |