Skip to content

Commit 34ee773

Browse files
committed
chore: update sample app to use artifact
1 parent 86c2f52 commit 34ee773

4 files changed

Lines changed: 52 additions & 42 deletions

File tree

.github/workflows/cd.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
# Using TrustedPublisher for NuGet publishing
2+
# The workflow name is set to cd.yml and should be updated if this file is renamed.
3+
# We do NOT need NUGET_API_KEY in secrets.
14
name: Publish to Github & NuGet
25

36
permissions:
7+
id-token: write # Required for OIDC
48
contents: write
59

610
on:
@@ -36,6 +40,13 @@ jobs:
3640
uses: actions/setup-dotnet@v5
3741
with:
3842
dotnet-version: "10.0.x"
43+
44+
- name: NuGet login
45+
uses: nuget/login@v1
46+
id: login
47+
with:
48+
# TODO: Replace with OneSignal on approval
49+
user: fadi-onesignal
3950

4051
- name: Restore workloads
4152
run: dotnet workload restore
@@ -50,7 +61,7 @@ jobs:
5061
run: dotnet pack OneSignalSDK.DotNet/OneSignalSDK.DotNet.csproj --no-build -c Release /p:NuspecFile=../OneSignalSDK.DotNet.nuspec -o ./artifacts
5162

5263
- name: Publish to NuGet
53-
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
64+
run: dotnet nuget push ./artifacts/*.nupkg --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
5465

5566
create-release:
5667
needs: publish

Samples/OneSignalApp/OneSignalApp.csproj

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,21 @@
5252
</ItemGroup>
5353

5454
<ItemGroup>
55-
<ProjectReference Include="..\..\OneSignalSDK.DotNet\OneSignalSDK.DotNet.csproj" />
56-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Core\OneSignalSDK.DotNet.Core.csproj" />
55+
<PackageReference Include="OneSignalSDK.DotNet" Version="6.0.0" />
5756
</ItemGroup>
5857

5958
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
6059
<GoogleServicesJson Include="Platforms\Android\google-services.json" />
61-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Android\OneSignalSDK.DotNet.Android.csproj" />
62-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Android.Core.Binding\OneSignalSDK.DotNet.Android.Core.Binding.csproj" />
63-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Android.InAppMessages.Binding\OneSignalSDK.DotNet.Android.InAppMessages.Binding.csproj" />
64-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Android.Location.Binding\OneSignalSDK.DotNet.Android.Location.Binding.csproj" />
65-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Android.Notifications.Binding\OneSignalSDK.DotNet.Android.Notifications.Binding.csproj" />
6660
</ItemGroup>
6761

68-
<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
69-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.iOS\OneSignalSDK.DotNet.iOS.csproj" />
70-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.iOS.Binding\OneSignalSDK.DotNet.iOS.Binding.csproj" />
71-
<!-- LIVE ACTIVITES: UNCOMMENT BELOW OUT FOR LIVE ACTIVITIES WIDGET -->
72-
<!-- <AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../native/example/">
62+
<!-- LIVE ACTIVITES: UNCOMMENT BELOW OUT FOR LIVE ACTIVITIES WIDGET -->
63+
<!-- <ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
64+
<AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../native/example/">
7365
<Name>ExampleWidgetExtension</Name>
7466
<BuildOutput Condition="!$(RuntimeIdentifier.Contains('simulator'))">DerivedData/example/Build/Products/Debug-iphoneos</BuildOutput>
7567
<BuildOutput Condition="$(RuntimeIdentifier.Contains('simulator'))">DerivedData/example/Build/Products/Debug-iphonesimulator</BuildOutput>
76-
</AdditionalAppExtensions> -->
77-
</ItemGroup>
68+
</AdditionalAppExtensions>
69+
</ItemGroup> -->
7870

7971
<ItemGroup>
8072
<None Remove="Models\" />

Samples/OneSignalApp/nuget.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
5+
<add key="local" value="../../artifacts" />
6+
</packageSources>
7+
</configuration>
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net10.0-ios</TargetFrameworks>
4-
<OutputType>Library</OutputType>
5-
<ApplicationId>com.onesignal.exampledotnet.OneSignalNotificationServiceExtension</ApplicationId>
6-
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
7-
<ApplicationVersion>1</ApplicationVersion>
8-
<SupportedOSPlatformVersion>15.4</SupportedOSPlatformVersion>
9-
</PropertyGroup>
10-
<PropertyGroup>
11-
<IsAppExtension>true</IsAppExtension>
12-
<IsWatchExtension>false</IsWatchExtension>
13-
</PropertyGroup>
14-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15-
<CreatePackage>false</CreatePackage>
16-
<CodesignProvision>Automatic</CodesignProvision>
17-
<CodesignKey>iPhone Developer</CodesignKey>
18-
</PropertyGroup>
19-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
20-
<CreatePackage>false</CreatePackage>
21-
</PropertyGroup>
22-
<ItemGroup>
23-
<ProjectReference Include="..\..\OneSignalSDK.DotNet\OneSignalSDK.DotNet.csproj" />
24-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.iOS\OneSignalSDK.DotNet.iOS.csproj" />
25-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.iOS.Binding\OneSignalSDK.DotNet.iOS.Binding.csproj" />
26-
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Core\OneSignalSDK.DotNet.Core.csproj" />
27-
</ItemGroup>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net10.0-ios</TargetFrameworks>
4+
<OutputType>Library</OutputType>
5+
<ApplicationId>com.onesignal.exampledotnet.OneSignalNotificationServiceExtension</ApplicationId>
6+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
7+
<ApplicationVersion>1</ApplicationVersion>
8+
<SupportedOSPlatformVersion>15.4</SupportedOSPlatformVersion>
9+
</PropertyGroup>
10+
<PropertyGroup>
11+
<IsAppExtension>true</IsAppExtension>
12+
<IsWatchExtension>false</IsWatchExtension>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15+
<CreatePackage>false</CreatePackage>
16+
<CodesignProvision>Automatic</CodesignProvision>
17+
<CodesignKey>iPhone Developer</CodesignKey>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
20+
<CreatePackage>false</CreatePackage>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<ProjectReference Include="..\..\OneSignalSDK.DotNet\OneSignalSDK.DotNet.csproj" />
24+
<ProjectReference Include="..\..\OneSignalSDK.DotNet.iOS\OneSignalSDK.DotNet.iOS.csproj" />
25+
<ProjectReference Include="..\..\OneSignalSDK.DotNet.iOS.Binding\OneSignalSDK.DotNet.iOS.Binding.csproj" />
26+
<ProjectReference Include="..\..\OneSignalSDK.DotNet.Core\OneSignalSDK.DotNet.Core.csproj" />
27+
</ItemGroup>
2828
</Project>

0 commit comments

Comments
 (0)