-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
71 lines (67 loc) · 2.06 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
variables:
- group: ApiKeys
- name: configuration
value: Release
trigger:
batch: true
branches:
include:
- '*'
exclude:
- 'noci[/-]*'
tags:
include:
- 'v*'
jobs:
- job: Windows
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 8.0 sdk'
inputs:
packageType: sdk
version: 8.0.x
- pwsh: |
chcp 65001
dotnet build --configuration $(configuration)
dotnet test --no-build --configuration $(configuration) --logger 'trx' --logger 'console;verbosity=normal'
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/TestResults/*.trx'
- job: Linux
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 8.0 sdk'
inputs:
packageType: sdk
version: 8.0.x
- bash: |
set -euxo pipefail
dotnet tool restore
dotnet build --configuration $(configuration)
dotnet test --no-build --configuration $(configuration) --logger 'trx' --logger 'console;verbosity=normal'
# FIXME: The pack command below _should_ use --no-build too. Problem is
# that doing so when an F# project depends on a C# one causes
# a spurious re-build for some reason and ends up in NETSDK1085
# https://github.com/dotnet/fsharp/issues/12320
dotnet pack --configuration $(configuration) --output=$(Build.ArtifactStagingDirectory)
# Check code format. Fantomas for F#, dotnet format for C#
dotnet tool run fantomas --check .
dotnet format --verify-no-changes
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/TestResults/*.trx'
- publish: $(Build.ArtifactStagingDirectory)
artifact: NuGet
- script: |
dotnet nuget push --api-key $API_KEY --source "NuGetOrg" $(Build.ArtifactStagingDirectory)/*.nupkg
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
env:
API_KEY: $(NuGetOrgApiKey)