-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.yml
More file actions
59 lines (50 loc) · 1.68 KB
/
Copy pathbuild.yml
File metadata and controls
59 lines (50 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
trigger:
batch: false
branches:
include:
- main
pool:
name: Default
demands: Agent.OS -equals Windows_NT
variables:
- group: Nuget
steps:
- pwsh: |
Get-ChildItem -Path '$(Build.ArtifactStagingDirectory)' -Recurse -Include *.nupkg, *.snupkg | Remove-Item
Get-ChildItem -Path '$(Build.SourcesDirectory)' -Recurse -Include *.nupkg, *.snupkg | Remove-Item
displayName: Clear NuGet packages
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: Kros.KORM.MsAccess.slnx
arguments: --configuration Release
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: Kros.KORM.MsAccess.slnx
publishTestResults: false
arguments: --configuration Release --logger trx --results-directory "$(Common.TestResultsDirectory)"
- task: PublishTestResults@2
displayName: Publish test results
condition: always()
inputs:
testResultsFormat: VSTest
testResultsFiles: '*.trx'
searchFolder: $(Common.TestResultsDirectory)
- ${{ if in(variables['Build.SourceBranchName'], 'main', 'net48') }}:
- task: CopyFiles@2
displayName: Copy package files to staging directory
inputs:
Contents: |
**/*.nupkg
**/*.snupkg
TargetFolder: $(Build.ArtifactStagingDirectory)
FlattenFolders: true
- pwsh: |
Get-ChildItem '$(Build.ArtifactStagingDirectory)/*.nupkg' | ForEach-Object {
Write-Host 'Pushing package $($_.Name)'
dotnet nuget push --api-key $(nugetOrgApiKey) --source 'https://api.nuget.org/v3/index.json' --skip-duplicate $_.FullName
}
displayName: Push to NuGet.org