Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/create_nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish NuGet Package

on:
push:
branches:
- master

jobs:
publish_to_nuget:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./LicencingNET

name: Update NuGet
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0'
source-url: https://nuget.pkg.github.com/RemoteCloud/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build source
run: dotnet build --configuration Release

- name: Create package
run: dotnet pack LicencingNET.csproj --output nuget-package --configuration Release

# --no-symbols true is a bug workaround. In the future --no-symbols should just work
- name: Push to GitHub registry
run: dotnet nuget push ./nuget-package/*.nupkg --skip-duplicate --no-symbols true --api-key ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions LicencingNET/Licence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public ValidationResult Validate(AsymmetricAlgorithm publicKey, bool useNtp = tr
return ValidationResult.NotStarted;
}

using (SHA512CryptoServiceProvider sha = new SHA512CryptoServiceProvider())
using (SHA512 sha = SHA512.Create())
{
byte[] licenceBinary = ToBinary(false);

Expand Down Expand Up @@ -209,7 +209,7 @@ public bool Sign(AsymmetricAlgorithm privateKey)
throw new ArgumentNullException(nameof(privateKey), "Private key cannot be null");
}

using (SHA512CryptoServiceProvider sha = new SHA512CryptoServiceProvider())
using (SHA512 sha = SHA512.Create())
{
byte[] licenceBinary = ToBinary(false);

Expand Down
15 changes: 14 additions & 1 deletion LicencingNET/LicencingNET.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>7.1</LangVersion>
<TargetFrameworks>net35;net45;net471;netcoreapp2.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<PackageLicenseFile>LICENCE</PackageLicenseFile>
<RepositoryUrl>https://github.com/RemoteCloud/LicencingNET</RepositoryUrl>
<Copyright>MIT Licence</Copyright>
<PackageProjectUrl>https://github.com/TwoTenPvP/LicencingNET</PackageProjectUrl>
<Description>Fork of LicencingNET project with the intention of building a NuGet package.</Description>
<PackageId>Maranics.LicencingNET</PackageId>
<PackageReleaseNotes>Contains pull request 2 modifications to be compatible with NET Framework 3.5</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<None Include="..\LICENCE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>