chore: Release 6.2.4 #51
Workflow file for this run
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
| # Using TrustedPublisher for NuGet publishing | |
| # The workflow name is set to cd.yml and should be updated if this file is renamed. | |
| # We do NOT need NUGET_API_KEY in secrets. | |
| name: Publish to Github & NuGet | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write | |
| pull-requests: read # Required by called github-release.yml | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| - rel/** | |
| jobs: | |
| publish: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.pull_request.merged == true && | |
| contains(github.event.pull_request.title, 'chore: Release')) | |
| # OneSignalSDK.DotNet.csproj adds the net10.0-ios TFM on macOS hosts, | |
| # so the publish build needs an Xcode that satisfies the .NET 10 iOS | |
| # workload. The current workload set (10.0.300+) requires Xcode 26.4, | |
| # which only ships on macos-26 (default Xcode 26.4.1). macos-latest | |
| # still maps to macos-15 with Xcode 26.3 until June 15, 2026. | |
| runs-on: macos-26 | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Get version from nuspec | |
| id: version | |
| run: | | |
| VERSION=$(grep '<version>' OneSignalSDK.DotNet.nuspec | sed -E 's/.*<version>([^<]+)<\/version>.*/\1/' | head -1) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: NuGet login | |
| uses: nuget/login@v1 | |
| id: login | |
| with: | |
| # Needs to be an Owner (not an Org) of the package | |
| user: OneSignal_SDK | |
| - name: Restore workloads | |
| run: dotnet workload restore | |
| - name: Build | |
| run: dotnet build OneSignalSDK.DotNet/OneSignalSDK.DotNet.csproj -c Release /p:Version=${{ steps.version.outputs.version }} | |
| - name: Extract iOS resources | |
| run: unzip OneSignalSDK.DotNet.iOS.Binding/bin/Release/net10.0-ios/OneSignalSDK.DotNet.iOS.Binding.resources.zip -d OneSignalSDK.DotNet.iOS.Binding/bin/Release/net10.0-ios/OneSignalSDK.DotNet.iOS.Binding.resources/ | |
| - name: Pack | |
| run: dotnet pack OneSignalSDK.DotNet/OneSignalSDK.DotNet.csproj --no-build -c Release /p:NuspecFile=../OneSignalSDK.DotNet.nuspec -o ./artifacts | |
| - name: Publish to NuGet | |
| run: dotnet nuget push ./artifacts/*.nupkg --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| create-release: | |
| needs: publish | |
| uses: OneSignal/sdk-shared/.github/workflows/github-release.yml@main | |
| secrets: | |
| GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }} | |
| with: | |
| version: ${{ needs.publish.outputs.version }} |