-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add azure pipelines for build and for publish nuget
- Loading branch information
AndreyDeev
committed
Dec 15, 2023
1 parent
4593884
commit 482a781
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
trigger: | ||
- zero | ||
|
||
pool: | ||
vmImage: 'windows-2022' | ||
|
||
name: $(Date:yyyyMMdd).$(Rev:r) | ||
|
||
variables: | ||
solution: 'LiteDB.sln' | ||
buildPlatform: 'Any CPU' | ||
buildConfiguration: 'Release' | ||
|
||
steps: | ||
- task: NuGetToolInstaller@1 | ||
|
||
- task: NuGetCommand@2 | ||
inputs: | ||
command: 'restore' | ||
restoreSolution: '$(Build.SourcesDirectory)\$(solution)' | ||
feedsToUse: 'select' | ||
vstsFeed: '37514f74-c7cc-4c80-ad25-a7ede6743148' | ||
|
||
- task: VSBuild@1 | ||
displayName: 'Compile' | ||
inputs: | ||
solution: '$(solution)' | ||
platform: '$(buildPlatform)' | ||
configuration: '$(buildConfiguration)' | ||
maximumCpuCount: true | ||
|
||
# At the moment of writing, Azure Pipelines use 17.3.0-preview-20220626-01 test platform version, | ||
# That has some bugs regarding xUnit tests, thus specifying a stable version explicitly. | ||
# See https://stackoverflow.com/a/73414352/1828989. | ||
|
||
#- task: VisualStudioTestPlatformInstaller@1 | ||
# inputs: | ||
# versionSelector: 'SpecificVersion' | ||
# testPlatformVersion: '17.2.0' | ||
|
||
- task: VSTest@2 | ||
displayName: 'Unit Tests' | ||
inputs: | ||
platform: '$(buildPlatform)' | ||
configuration: '$(buildConfiguration)' | ||
testSelector: 'testAssemblies' | ||
testAssemblyVer2: | | ||
**\LiteDB.Tests.dll | ||
!**\obj\** | ||
!**\ref\** | ||
searchFolder: '$(System.DefaultWorkingDirectory)' | ||
runInParallel: true | ||
vsTestVersion: 'toolsInstaller' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
trigger: none | ||
pr: none | ||
|
||
pool: | ||
vmImage: 'windows-2022' | ||
|
||
name: $(majorMinorVersion).$(semanticVersion) | ||
|
||
variables: | ||
solution: 'LiteDB.sln' | ||
buildConfiguration: 'Release' | ||
majorMinorVersion: 5.0.17 | ||
# semanticVersion counter is automatically incremented by one in each execution of pipeline | ||
# second parameter is seed value to reset to every time the referenced majorMinorVersion is changed | ||
semanticVersion: $[counter(variables['majorMinorVersion'], 0)]-patch | ||
|
||
steps: | ||
- task: NuGetToolInstaller@1 | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'NuGet Restore' | ||
inputs: | ||
command: 'custom' | ||
arguments: 'restore $(Build.SourcesDirectory)\$(solution) -LockedMode -Verbosity Detailed -NonInteractive' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'dotnet pack' | ||
inputs: | ||
command: 'pack' | ||
configuration: '$(buildConfiguration)' | ||
packagesToPack: '**/LiteDB.csproj' | ||
includesymbols: true | ||
versioningScheme: byBuildNumber | ||
|
||
- task: NuGetAuthenticate@0 | ||
displayName: 'NuGet Authenticate' | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'NuGet push' | ||
inputs: | ||
command: 'push' | ||
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' | ||
nuGetFeedType: 'internal' | ||
publishVstsFeed: '37514f74-c7cc-4c80-ad25-a7ede6743148' | ||
allowPackageConflicts: true |