Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a separate web SDK for clients without HTTP 2.0 #568

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/on-push-to-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ jobs:
with:
dotnet-version: "6.0.x"

- name: Build
run: make build

- name: Pack and Publish
- name: Pack and Publish the standard SDK
run: |
set -x
pushd src/Momento.Sdk
Expand All @@ -57,6 +54,17 @@ jobs:
dotnet pack -c Release -p:Version=${VERSION}
dotnet nuget push ./bin/Release/Momento.Sdk.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key=${{secrets.NUGET_API_KEY}}
popd

- name: Pack and Publish the web SDK
run: |
set -x
pushd src/Momento.Sdk
VERSION="${{ needs.release.outputs.version }}"
echo "version: ${VERSION}"
dotnet build -p:DefineConstants=USE_GRPC_WEB --configuration Release
dotnet pack -p:DefineConstants=USE_GRPC_WEB -c Release -p:Version=${VERSION}
dotnet nuget push ./bin/Release/Momento.Sdk.Web.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key=${{secrets.NUGET_API_KEY}}
popd

- name: Build for Unity
run: |
Expand All @@ -68,7 +76,7 @@ jobs:
dotnet publish --configuration Release -f netstandard2.0 -p:DefineConstants=USE_GRPC_WEB -p:VersionPrefix=${VERSION}
mkdir ./bin/Release/netstandard2.0/MomentoSdkUnity
pushd ./bin/Release/netstandard2.0/publish/
cp Google.Protobuf.dll Grpc.Core.Api.dll Grpc.Net.Client.dll Grpc.Net.Client.Web.dll Grpc.Net.Common.dll JWT.dll Microsoft.Bcl.AsyncInterfaces.dll Microsoft.Extensions.Logging.Abstractions.dll Momento.Protos.dll Momento.Sdk.dll Newtonsoft.Json.dll System.Diagnostics.DiagnosticSource.dll System.Runtime.CompilerServices.Unsafe.dll System.Threading.Channels.dll ../MomentoSdkUnity/
cp Google.Protobuf.dll Grpc.Core.Api.dll Grpc.Net.Client.dll Grpc.Net.Client.Web.dll Grpc.Net.Common.dll JWT.dll Microsoft.Bcl.AsyncInterfaces.dll Microsoft.Extensions.Logging.Abstractions.dll Momento.Protos.dll Momento.Sdk.Web.dll Newtonsoft.Json.dll System.Diagnostics.DiagnosticSource.dll System.Runtime.CompilerServices.Unsafe.dll System.Threading.Channels.dll ../MomentoSdkUnity/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need to update the unity demo docs after this goes in

popd
zip -jr MomentoSdkUnity.zip bin/Release/netstandard2.0/MomentoSdkUnity/
ZIP_FILE=./MomentoSdkUnity.zip
Expand Down
37 changes: 28 additions & 9 deletions src/Momento.Sdk/Momento.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,43 @@
<IncludeSymbols>true</IncludeSymbols>
<!-- Publish the repository URL in the built .nupkg -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Package metadata -->
<PackageId>Momento.Sdk</PackageId>

<!-- Common package metadata -->
<Authors>Momento</Authors>
<Company>Momento Inc</Company>
<Description>
C# SDK for Momento, a serverless cache that automatically scales without any of the
operational overhead required by traditional caching solutions.

Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
</Description>
<PackageTags>caching, cache, serverless, key value, simple caching service, distributedcache</PackageTags>
<Copyright>Copyright (c) Momento Inc 2022</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/momentohq/client-sdk-dotnet</PackageProjectUrl>
<RepositoryUrl>https://github.com/momentohq/client-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<!-- The standard SDK package that builds by default -->
<PropertyGroup>
<PackageId>Momento.Sdk</PackageId>
<AssemblyName>Momento.Sdk</AssemblyName>
<Description>
C# SDK for Momento, a serverless cache that automatically scales without any of the
operational overhead required by traditional caching solutions.

Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
</Description>
</PropertyGroup>

<!-- The web SDK package that builds instead of the standard if the gRPC web constant is defined -->
<PropertyGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
<PackageId>Momento.Sdk.Web</PackageId>
<AssemblyName>Momento.Sdk.Web</AssemblyName>
<Description>
C# Web SDK for Momento, a serverless cache that automatically scales without any of the
operational overhead required by traditional caching solutions.

This version of the SDK uses gRPC-Web and is for clients that don't have access to HTTP 2.0.

Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
</Description>
</PropertyGroup>

<ItemGroup>
<None Remove="System.Threading.Channels" />
<None Remove="Internal\Middleware\" />
Expand Down Expand Up @@ -60,7 +80,6 @@
<PackageReference Include="System.Threading" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
<!-- Currently the Unity build needs gRPC-Web -->
<PackageReference Include="Grpc.Net.Client.Web" Version="2.63.0" />
</ItemGroup>
<ProjectExtensions>
Expand Down
Loading