diff --git a/.azure/pipelines/azure-pipelines-external-release.yml b/.azure/pipelines/azure-pipelines-external-release.yml index 2c4ac22da6..9f1e88e9f2 100644 --- a/.azure/pipelines/azure-pipelines-external-release.yml +++ b/.azure/pipelines/azure-pipelines-external-release.yml @@ -1,22 +1,20 @@ ###################################### -# NOTE: Before running this pipeline to generate a new nuget package, update the version string in two places -# 1) update the name: string below (line 7) -- this is the version for the nuget package (e.g. 1.0.0) -# 2) update \libs\host\GarnetServer.cs readonly string version (~line 32) -- NOTE - these two values need to be the same -# 3) update the version in GarnetServer.csproj (~line 8) +# NOTE: Before running this pipeline to generate a the GitHub Release and new nuget packages, update the VersionPrefix value in Version.props file +# NOTE: When Version.props file is modified, this pipeline will automatically get triggered ###################################### -name: 1.0.41 trigger: branches: include: - main paths: include: - - .azure/pipelines/azure-pipelines-external-release.yml + - Version.props resources: repositories: - repository: self type: git ref: refs/heads/main + jobs: - job: Phase_1 displayName: Assessment @@ -28,6 +26,13 @@ jobs: clean: False submodules: recursive persistCredentials: True + + - task: PowerShell@2 + displayName: 'Extract version number from Version.props' + inputs: + filePath: .azure/pipelines/extract_version.ps1 + workingDirectory: .azure/pipelines + - task: UseDotNet@2 displayName: Use .NET Core sdk 6.0.x - needed for code signing inputs: @@ -36,21 +41,11 @@ jobs: displayName: Use .NET Core sdk 8.0.x inputs: version: 8.0.x - - task: NuGetToolInstaller@1 - displayName: Nuget Tool Installer - inputs: - versionspec: '*' - checkLatest: true - - task: NuGetAuthenticate@1 - displayName: NuGet Authenticate - - task: NuGetAuthenticate@1 - displayName: 'NuGet Authenticate' - task: DotNetCoreCLI@2 displayName: dotnet build - enabled: True inputs: - projects: '**/Garnet.*.csproj' + projects: '**/Garnet*.csproj' arguments: -c Release - task: PowerShell@2 @@ -62,7 +57,6 @@ jobs: - task: EsrpCodeSigning@5 displayName: Sign the binaries for nuget and zipped files - enabled: True inputs: ConnectedServiceName: 'GarnetCodeSigningOneCert' AppRegistrationClientId: '19bbb452-ce7a-4b3d-bdc4-42a0090e797b' @@ -71,7 +65,7 @@ jobs: AuthCertName: 'Garnet-CodeSign-AuthCert' AuthSignCertName: 'Garnet-CodeSigning-SigningCertificate' FolderPath: . - Pattern: Garnet.server.dll,Garnet.client.dll,Garnet.common.dll,Garnet.cluster.dll,Garnet.host.dll,HdrHistogram.dll,Tsavorite.core.dll,Tsavorite.devices.AzureStorageDevice.dll,native_device.dll,GarnetServer.exe + Pattern: Garnet*.dll,Tsavorite*.dll,Garnet*.exe,HdrHistogram.dll,native_device.dll,*Lua.dll signConfigType: inlineSignParams inlineOperation: >- [ @@ -99,31 +93,20 @@ jobs: SessionTimeout: 20 VerboseLogin: true - - task: NuGetCommand@2 - displayName: nuget pack Garnet - enabled: True - inputs: - command: custom - arguments: pack Garnet.nuspec -OutputDirectory $(Build.ArtifactStagingDirectory) -Symbols -SymbolPackageFormat snupkg -version $(Build.BuildNumber) -Verbosity Detailed - - # Do after Nuget Pack so not part of Nuget Pack - - task: PowerShell@2 - displayName: 'Zip the GarnetServer binaries' + - task: CmdLine@2 + displayName: nuget pack Garnet Library inputs: - filePath: .azure/pipelines/createbinaries.ps1 - arguments: 2 - workingDirectory: .azure/pipelines + workingDirectory: $(System.DefaultWorkingDirectory) + script: 'dotnet pack --no-build --no-restore --output $(Build.ArtifactStagingDirectory) -p:PackageVersion=$(Build.BuildNumber) /p:Configuration=Release libs/host/Garnet.host.csproj' - - task: CopyFiles@2 - displayName: 'Copy Zipped Files to Artifacts dir: $(Build.artifactstagingdirectory)' + - task: CmdLine@2 + displayName: nuget pack Garnet Server inputs: - Contents: '**' - SourceFolder: '$(Build.SourcesDirectory)/main/GarnetServer/bin/Release/net8.0/publish/output' - TargetFolder: $(build.artifactstagingdirectory) + workingDirectory: $(System.DefaultWorkingDirectory) + script: 'dotnet pack --no-build --no-restore --output $(Build.ArtifactStagingDirectory) -p:PackageVersion=$(Build.BuildNumber) /p:Configuration=Release main/GarnetServer/GarnetServer.csproj' - task: EsrpCodeSigning@5 - displayName: Sign the NuGet Package - enabled: true + displayName: Sign the NuGet Packages inputs: ConnectedServiceName: 'GarnetCodeSigningOneCert' AppRegistrationClientId: '19bbb452-ce7a-4b3d-bdc4-42a0090e797b' @@ -132,7 +115,7 @@ jobs: AuthCertName: 'Garnet-CodeSign-AuthCert' AuthSignCertName: 'Garnet-CodeSigning-SigningCertificate' FolderPath: $(Build.ArtifactStagingDirectory) - Pattern: Microsoft.Garnet.*.nupkg + Pattern: Microsoft.Garnet.*.nupkg, garnet-server.*.nupkg signConfigType: inlineSignParams inlineOperation: >- [ @@ -160,13 +143,26 @@ jobs: SessionTimeout: 20 VerboseLogin: true + # Do after Nuget Pack so not part of Nuget Pack + - task: PowerShell@2 + displayName: 'Zip the GarnetServer binaries' + inputs: + filePath: .azure/pipelines/createbinaries.ps1 + arguments: 2 + workingDirectory: .azure/pipelines + + - task: CopyFiles@2 + displayName: 'Copy Zipped Files to Artifacts dir: $(Build.artifactstagingdirectory)' + inputs: + Contents: '**' + SourceFolder: '$(Build.SourcesDirectory)/main/GarnetServer/bin/Release/net8.0/publish/output' + TargetFolder: $(build.artifactstagingdirectory) + - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' - enabled: True - task: GitHubRelease@1 displayName: 'Create the GitHub release' - enabled: True inputs: action: 'create' gitHubConnection: ADO_to_Github_ServiceConnection @@ -190,8 +186,7 @@ jobs: $(Build.ArtifactStagingDirectory)/*.7z - task: NuGetCommand@2 - displayName: 'Push to NuGet.org' - enabled: True + displayName: 'Push both packages to NuGet.org' inputs: command: push packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg' diff --git a/.azure/pipelines/extract_version.ps1 b/.azure/pipelines/extract_version.ps1 new file mode 100644 index 0000000000..f4a3f7000b --- /dev/null +++ b/.azure/pipelines/extract_version.ps1 @@ -0,0 +1,11 @@ +<#$f +.DESCRIPTION + + This script pulls the version number from Version.props which is located in the root directory. + It then assigns the value to the BuildNumber which can be used in pipeline yml files +#> + +$propsFile = Resolve-Path -Path "$PSScriptRoot/../../Version.props" +[xml]$xml = Get-Content -Path $propsFile +$version = $xml.Project.PropertyGroup.VersionPrefix +Write-Host "##vso[build.updatebuildnumber]$version" \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 2589702be8..1e6e6b08c6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,12 @@ - + net8.0 + + + latest true @@ -11,4 +14,46 @@ true + + true + + + + + embedded + false + false + + + + + + + + + + + + + + Garnet + Microsoft + Microsoft + git + https://github.com/microsoft/garnet.git + https://microsoft.github.io/garnet + MIT + True + + Garnet is a remote cache-store from Microsoft Research, that offers strong performance (throughput and latency), + scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet uses the Redis RESP wire + protocol and can work with existing Redis clients. + + garnet-logo-diamond.png + See https://github.com/microsoft/garnet for details. + © Microsoft Corporation. All rights reserved. + en-US + Garnet key-value store cache dictionary hashtable concurrent persistent remote cluster Redis RESP + + \ No newline at end of file diff --git a/Garnet.nuspec b/Garnet.nuspec deleted file mode 100644 index 4f025e27c5..0000000000 --- a/Garnet.nuspec +++ /dev/null @@ -1,67 +0,0 @@ - - - - Microsoft.Garnet - $version$ - Garnet - Microsoft - https://microsoft.github.io/garnet - - Garnet is a remote cache-store from Microsoft Research, that offers strong performance (throughput and latency), - scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet uses the Redis RESP wire - protocol and can work with existing Redis clients. - MIT - true - See https://github.com/microsoft/garnet for details. - © Microsoft Corporation. All rights reserved. - en-US - Garnet key-value store cache dictionary hashtable concurrent persistent remote cluster Redis RESP - - - - - - - - - - - - - README.md - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Garnet.sln b/Garnet.sln index 1a7f8dffd2..de3020e5d6 100644 --- a/Garnet.sln +++ b/Garnet.sln @@ -42,7 +42,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Dockerfile.chiseled = Dockerfile.chiseled Dockerfile.nanoserver = Dockerfile.nanoserver Dockerfile.ubuntu = Dockerfile.ubuntu - Garnet.nuspec = Garnet.nuspec + .azure\pipelines\extract_version.ps1 = .azure\pipelines\extract_version.ps1 + Version.props = Version.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bitmap", "playground\Bitmap\Bitmap.csproj", "{B9FA7D45-6DAE-4D56-AD7E-BB6C987A58C5}" @@ -98,7 +99,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleModule", "playground\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GarnetJSON", "playground\GarnetJSON\GarnetJSON.csproj", "{2C8F1F5D-31E5-4D00-A46E-F3B1D9BC098F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MigrateBench", "playground\MigrateBench\MigrateBench.csproj", "{6B66B394-E410-4B61-9A5A-1595FF6F5E08}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigrateBench", "playground\MigrateBench\MigrateBench.csproj", "{6B66B394-E410-4B61-9A5A-1595FF6F5E08}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hosting", "hosting", "{01823EA4-4446-4D66-B268-DFEE55951964}" EndProject @@ -106,7 +107,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windows", "Windows", "{6977 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Garnet.worker", "hosting\Windows\Garnet.worker\Garnet.worker.csproj", "{DF2DD03E-87EE-482A-9FBA-6C8FBC23BDC5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Garnet.resources", "libs\resources\Garnet.resources.csproj", "{A48412B4-FD60-467E-A5D9-F155CAB4F907}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Garnet.resources", "libs\resources\Garnet.resources.csproj", "{A48412B4-FD60-467E-A5D9-F155CAB4F907}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Version.props b/Version.props new file mode 100644 index 0000000000..c2c234c0e4 --- /dev/null +++ b/Version.props @@ -0,0 +1,6 @@ + + + + 1.0.42 + + \ No newline at end of file diff --git a/libs/host/Garnet.host.csproj b/libs/host/Garnet.host.csproj index 1db8c08f2b..6faacd037c 100644 --- a/libs/host/Garnet.host.csproj +++ b/libs/host/Garnet.host.csproj @@ -5,6 +5,8 @@ ../../Garnet.snk false true + Microsoft.Garnet + README.md @@ -29,4 +31,12 @@ - \ No newline at end of file + + + + + + + + + diff --git a/libs/host/GarnetServer.cs b/libs/host/GarnetServer.cs index f71b92f0e8..2513ecf10a 100644 --- a/libs/host/GarnetServer.cs +++ b/libs/host/GarnetServer.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using System.Threading; using Garnet.cluster; @@ -28,8 +29,12 @@ namespace Garnet /// public class GarnetServer : IDisposable { - // IMPORTANT: Keep the version in sync with .azure\pipelines\azure-pipelines-external-release.yml line ~7 and GarnetServer.csproj line ~8. - readonly string version = "1.0.41"; + static readonly string version = GetVersion(); + static string GetVersion() + { + var Version = Assembly.GetExecutingAssembly().GetName().Version; + return $"{Version.Major}.{Version.Minor}.{Version.Build}"; + } internal GarnetProvider Provider; diff --git a/main/GarnetServer/GarnetServer.csproj b/main/GarnetServer/GarnetServer.csproj index 0f35f0aa6d..196f70ecd6 100644 --- a/main/GarnetServer/GarnetServer.csproj +++ b/main/GarnetServer/GarnetServer.csproj @@ -3,28 +3,10 @@ Exe true - - - 1.0.41 garnet-server - true garnet-server - The Microsoft.Garnet RESP server, packaged as a .NET tool - Microsoft - Microsoft - git - https://github.com/microsoft/garnet.git - https://microsoft.github.io/garnet - MIT - True - - Garnet is a remote cache-store from Microsoft Research, that offers strong performance (throughput and latency), - scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet uses the Redis RESP wire - protocol and can work with existing Redis clients. - - See https://github.com/microsoft/garnet for details. - © Microsoft Corporation. All rights reserved. - Garnet key-value store cache dictionary hashtable concurrent persistent remote cluster Redis RESP + true + README.md @@ -43,10 +25,8 @@ PreserveNewest - - - - readme.md - + + + \ No newline at end of file diff --git a/main/GarnetServer/readme.md b/main/GarnetServer/README.md similarity index 99% rename from main/GarnetServer/readme.md rename to main/GarnetServer/README.md index 3b238215e2..66f4f35794 100644 --- a/main/GarnetServer/readme.md +++ b/main/GarnetServer/README.md @@ -4,6 +4,5 @@ The `garnet-server` by itself will create a Garnet server using the default port; for full options, see `garnet-server --help`. - - [Full Garnet documentation](https://microsoft.github.io/garnet/) - [Garnet GitHub repository](https://github.com/microsoft/garnet.git) \ No newline at end of file diff --git a/website/static/img/logo_128.png b/website/static/img/logo_128.png new file mode 100644 index 0000000000..720cd1297a Binary files /dev/null and b/website/static/img/logo_128.png differ