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: drop grpc-web for .NET 4.62 build. #543

Merged
merged 6 commits into from
Mar 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
11 changes: 7 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ jobs:
build_csharp:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
target-framework: [net6.0]
grpc-web: [false, true]
include:
- os: ubuntu-latest
target-framework: net6.0
- os: windows-latest
target-framework: net6.0
target-framework: net462
grpc-web: false
- os: windows-latest
target-framework: net462
grpc-web: true
runs-on: ${{ matrix.os }}
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
Expand Down Expand Up @@ -47,7 +50,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: dotnet build
run: dotnet build ${{ matrix.grpc-web && '-p:DefineConstants=USE_GRPC_WEB' || '' }}

- name: Unit Test
run: dotnet test --logger "console;verbosity=detailed" -f ${{ matrix.target-framework }} tests/Unit/Momento.Sdk.Tests
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/on-push-to-main-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ jobs:
build_csharp:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
target-framework: [net6.0]
grpc-web: [false, true]
include:
- os: ubuntu-latest
target-framework: net6.0
- os: windows-latest
target-framework: net462
grpc-web: false
- os: windows-latest
target-framework: net462
grpc-web: true
runs-on: ${{ matrix.os }}
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
Expand All @@ -32,7 +37,7 @@ jobs:
dotnet-version: "6.0.x"

- name: Build
run: dotnet build
run: dotnet build ${{ matrix.grpc-web && '-p:DefineConstants=USE_GRPC_WEB' || '' }}

- name: Unit Test
run: dotnet test -f ${{ matrix.target-framework }} tests/Unit/Momento.Sdk.Tests
Expand Down
9 changes: 1 addition & 8 deletions src/Momento.Sdk/Momento.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
<RepositoryUrl>https://github.com/momentohq/client-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<!-- Because .NET Framework doesn't support HTTP/2, we use gRPC-Web over HTTP/1.1.
Dependency resolution: .NET Framework binaries or libraries >= v4.62 that link
to Momento.Sdk will link to the .NET Framework 4.62 build. -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net462' ">
<DefineConstants>USE_GRPC_WEB</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Remove="System.Threading.Channels" />
<None Remove="Internal\Middleware\" />
Expand Down Expand Up @@ -66,7 +59,7 @@
<PackageReference Include="System.Threading" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
<!-- Because .NET Framework does not support HTTP/2, we fall back to gRPC-Web over HTTP/1.1 -->
<!-- Currently the Unity build needs gRPC-Web -->
<PackageReference Include="Grpc.Net.Client.Web" Version="2.52.0" />
</ItemGroup>
<ProjectExtensions>
Expand Down
Loading