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

4.x #124

Merged
merged 15 commits into from
Jul 11, 2022
Merged
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish dotnet package to nuget

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- run: dotnet build --configuration Release MessageBird
- name: Create the package
run: dotnet pack --configuration Release /p:Version=${{github.event.release.tag_name}} MessageBird
- name: Publish the package to GPR
run: dotnet nuget push MessageBird/bin/Release/*.nupkg --api-key ${{secrets.NUGET_AUTH_TOKEN}} --source https://api.nuget.org/v3/index.json
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Dotnet Side by Side testing sample
name: Build and test
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.1.x
3.1.x
- run: dotnet build MessageBird -f netstandard2.0
- run: dotnet test Tests/UnitTests/MessageBirdUnitTests -f netcoreapp2.0
6.0.x
- run: dotnet build MessageBird
- run: dotnet test Tests/UnitTests/MessageBirdUnitTests
23 changes: 6 additions & 17 deletions MessageBird/MessageBird.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<Product>MessageBird</Product>
<Title>MessageBird</Title>
<Company>MessageBird</Company>
<Copyright>Copyright © 2019</Copyright>
<FileVersion>3.1.0.0</FileVersion>
<InformationalVersion>3.1.0.0</InformationalVersion>
<Version>3.1.0.0</Version>
<AssemblyVersion>3.1.0.0</AssemblyVersion>
<LangVersion>4</LangVersion>
<Copyright>Copyright © 2022</Copyright>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<!-- Conditionally obtain references for the .NET Framework 4.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
</ItemGroup>

<ItemGroup>
<PackageReference Include="JWT" Version="8.2.3" />

Choose a reason for hiding this comment

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

Really like the switch to target .net6.0.
Be ware that targetting .net6.0 might leave customers running on .NET Framework behind, as you are no longer targetting .netstandard 6.0.
https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0#net-standard-not-deprecated

Is it possible to remove this dependency to JWT and switch over to System.Text.Json? That would result in a library with only framework dependencies.
JWT package still depends on Newtonsoft.Json, there is an issue on their side to replace it: jwt-dotnet/jwt#364

Copy link
Contributor Author

@marcelcorso marcelcorso Jun 15, 2022

Choose a reason for hiding this comment

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

Yes. I think it's time we leave the .NET Framework behind.
Well make a major change release and then people have a chance to stay on old versions.

About your idea of using System's Jason.. it looks like a very good one.
We have limited c# knowledge these days over here so if you can do a PR or point us on the right direction it would be amazing

<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Objects\Common\" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>MessageBirdUnitTests</_Parameter1>
Expand Down
26 changes: 0 additions & 26 deletions MessageBird/MessageBird.csproj.nuspec

This file was deleted.

50 changes: 0 additions & 50 deletions MessageBird/Objects/Request.cs

This file was deleted.

86 changes: 0 additions & 86 deletions MessageBird/RequestSigner.cs

This file was deleted.

2 changes: 1 addition & 1 deletion MessageBird/RequestValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public RequestValidator(string secret, bool skipURLValidation = false)
}

/// <summary>
/// Internal constructor visible for unit testing.
/// Constructor that allows you to overwrite the dateTimeProvider for easier testing
/// </summary>
internal RequestValidator(string secret, IDateTimeProvider dateTimeProvider) : this(secret)
{
Expand Down
2 changes: 0 additions & 2 deletions NuGet/.gitignore

This file was deleted.

Binary file removed NuGet/MessageBird.dll
Binary file not shown.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Requirements

- [Sign up](https://www.messagebird.com/en/signup) for a free MessageBird account
- Create a new access_key in the developers sections
- MessageBird API client for C# requires **.NET Framework >= 4** or **.NET Standard >= 2.0**
- It has a dependency on **JSON.NET >= 4.5.6**

Installation
-----
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down Expand Up @@ -34,4 +34,4 @@
<ItemGroup>
<None Include="Responses\WebhooksList.json" />
</ItemGroup>
</Project>
</Project>
113 changes: 0 additions & 113 deletions Tests/UnitTests/MessageBirdUnitTests/Resources/RequestSignerTest.cs

This file was deleted.

Loading