-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
77 lines (66 loc) · 2.01 KB
/
azure-pipelines.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
trigger:
branches:
include:
- 'main'
tags:
include:
- '*'
variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
PKGVER: ${{ variables['Build.SourceBranchName'] }}
${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')) }}:
PKGVER: '0.0.0-dev'
SRC_PATH: 'src/*'
BuildConfiguration: Release
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macOS-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '8.0.x'
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: 'Pack'
inputs:
command: 'pack'
packagesToPack: '$(SRC_PATH)/*.*sproj'
versioningScheme: 'byEnvVar'
versionEnvVar: PKGVER
verbosityPack: 'Normal'
buildProperties: VersionPrefix=$(PKGVER)
condition: succeeded()
- task: InstallSSHKey@0
displayName: 'Install k8s-debug-poc repo deploy key'
inputs:
knownHostsEntry: 'github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl'
sshPublicKey: '$(ringPubKey)'
sshKeySecureFile: 'ring.key'
- task: DotNetCoreCLI@2
displayName: 'Test'
inputs:
command: 'run'
arguments: '-- --sequenced'
workingDirectory: tests/Ring.Tests.Integration
condition: succeeded()
#- task: PublishTestResults@2
# inputs:
# testResultsFiles: '$(System.DefaultWorkingDirectory)/testResults.xml'
# testResultsFormat: 'NUnit'
# failTaskOnFailedTests: true
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/tests/Ring.Tests.Integration/artifacts
artifactName: 'Logs ($(imageName))'
condition: always()
- bash: dotnet nuget push -s https://api.nuget.org/v3/index.json -k $(nuget-api-key) $(Build.ArtifactStagingDirectory)/*.nupkg
displayName: 'Push'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))