Skip to content

Commit

Permalink
Add azure pipelines for build and for publish nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyDeev committed Dec 15, 2023
1 parent 4593884 commit 482a781
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .azure/azure-build.yml
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'
45 changes: 45 additions & 0 deletions .azure/publish-nuget.yml
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

0 comments on commit 482a781

Please sign in to comment.