From 1e169aa4cd7c8fc835cbc34fb66bcfc202f9e807 Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Sat, 29 May 2021 02:30:02 +0300 Subject: [PATCH] Set up CI with Azure Pipelines (#9) --- CHANGELOG.md | 11 +++++++ SimpleOTP/SimpleOTP.csproj | 4 +++ azure-pipelines.yml | 66 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 azure-pipelines.yml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f2f4ffe --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +.NET library for TOTP/HOTP implementation on server (ASP.NET) or client (Xamarin) side + +## Features +- Generate and validate OTP codes +- Support of [TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_password) (RFC 6238) and [HOTP](https://en.wikipedia.org/wiki/HMAC-based_one-time_password) (RFC 4226) algorithms +- Support of HMAC-SHA1, HMAC-SHA256 and HMAC-SHA512 hashing algorithms +- Setup URI parser +- Database-ready configuration models +- Configuration generator for server-side implementation +- QR code generator +- No dependencies \ No newline at end of file diff --git a/SimpleOTP/SimpleOTP.csproj b/SimpleOTP/SimpleOTP.csproj index aa1f725..9b81df4 100644 --- a/SimpleOTP/SimpleOTP.csproj +++ b/SimpleOTP/SimpleOTP.csproj @@ -27,6 +27,10 @@ 1701;1702;AD0001 + + 1701;1702;AD0001 + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..952b5c0 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,66 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +trigger: +- master + +pool: + vmImage: 'windows-latest' + +variables: + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: NuGetToolInstaller@1 + displayName: 'Install NuGet tools' + +- task: NuGetCommand@2 + displayName: 'Restore NuGet packages' + inputs: + command: 'restore' + restoreSolution: '**/*.sln' + feedsToUse: 'select' + +- task: VSBuild@1 + displayName: 'Build library' + inputs: + solution: '**/SimpleOTP.csproj' + msbuildArgs: '/p:NoWarn=AD0001' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + msbuildArchitecture: 'x64' + +- task: VSBuild@1 + displayName: 'Build tests' + inputs: + solution: '**\*.Test.csproj' + +- task: VSTest@2 + displayName: 'Run tests' + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*.Tests.dll + !**\*TestAdapter.dll + !**\obj\** + !**\bin\**\ref\** + searchFolder: '$(System.DefaultWorkingDirectory)' + codeCoverageEnabled: true + +- task: CopyFiles@2 + displayName: 'Copy file to staging' + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)' + Contents: '**/Release/**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + flattenFolders: true + +- task: PublishBuildArtifacts@1 + displayName: 'Drop artifacts' + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'Artifacts' + publishLocation: 'Container' \ No newline at end of file