diff --git a/.github/workflows/create_nuget.yml b/.github/workflows/create_nuget.yml new file mode 100644 index 0000000..8ed387d --- /dev/null +++ b/.github/workflows/create_nuget.yml @@ -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 }} diff --git a/LicencingNET/Licence.cs b/LicencingNET/Licence.cs index 83e7436..2e898e4 100644 --- a/LicencingNET/Licence.cs +++ b/LicencingNET/Licence.cs @@ -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); @@ -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); diff --git a/LicencingNET/LicencingNET.csproj b/LicencingNET/LicencingNET.csproj index ed5f32a..eeb863f 100644 --- a/LicencingNET/LicencingNET.csproj +++ b/LicencingNET/LicencingNET.csproj @@ -1,6 +1,19 @@ 7.1 - net35;net45;net471;netcoreapp2.0;netstandard2.0 + netstandard2.0 + LICENCE + https://github.com/RemoteCloud/LicencingNET + MIT Licence + https://github.com/TwoTenPvP/LicencingNET + Fork of LicencingNET project with the intention of building a NuGet package. + Maranics.LicencingNET + Contains pull request 2 modifications to be compatible with NET Framework 3.5 + + + True + + +