Skip to content

Commit 2df4258

Browse files
authored
Merge pull request #267 from AArnott/addNbgvToolTest
Add nbgv tool to cloud runtime test
2 parents 7b964a0 + f2418cf commit 2df4258

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
.\nbgv cloud -p src -a
3434
displayName: Set build number
3535
condition: ne(variables['system.pullrequest.isfork'], true)
36+
37+
- task: DotNetCoreInstaller@0
38+
displayName: Install .NET Core SDK 2.1.400
39+
inputs:
40+
packageType: sdk
41+
version: 2.1.400
3642
- script: dotnet --info
3743
displayName: Show dotnet SDK info
3844

@@ -132,5 +138,7 @@ jobs:
132138
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true))
133139
pool:
134140
vmImage: macOS 10.13
141+
variables:
142+
DOTNET_ROOT: /Users/vsts/.dotnet
135143
steps:
136144
- template: azure-pipelines/xplattest-pipeline.yml

azure-pipelines/xplattest-pipeline.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
steps:
22
- checkout: none # skip checking out the default repository resource
3+
4+
- script: dotnet --info
5+
displayName: Show dotnet SDK info
6+
37
- task: DownloadBuildArtifacts@0
48
displayName: Download Build Artifacts
59
inputs:
610
artifactName: deployables
711
downloadPath: $(System.DefaultWorkingDirectory)
12+
813
- task: Bash@3
9-
displayName: Consume NB.GV from .NET Core build
14+
displayName: Set up git username and email address
1015
inputs:
11-
failOnStderr: true
1216
targetType: inline
13-
script: >
17+
script: |
1418
git config --global user.name ci
15-
1619
git config --global user.email [email protected]
1720
21+
- task: Bash@3
22+
displayName: Consume NB.GV from .NET Core build
23+
inputs:
24+
failOnStderr: true
25+
targetType: inline
26+
script: >
1827
PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
1928
2029
NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
@@ -29,3 +38,19 @@ steps:
2938
git commit -m "Initial commit" &&
3039
dotnet pack -c debug &&
3140
if ! ls bin/debug/lib.42.42.1*.nupkg 1> /dev/null 2>&1; then exit 1; fi
41+
42+
- task: Bash@3
43+
displayName: Use nbgv dotnet CLI tool
44+
inputs:
45+
failOnStderr: true
46+
targetType: inline
47+
script: >
48+
echo DOTNET_ROOT=$DOTNET_ROOT
49+
50+
PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
51+
52+
NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
53+
54+
dotnet tool install nbgv --tool-path . --version $NBGV_NuGetPackageVersion --add-source deployables &&
55+
./nbgv get-version -f json -p lib &&
56+
./nbgv get-version -f json -p lib | grep 42.42.1

src/global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "2.1.400"
4+
}
5+
}

0 commit comments

Comments
 (0)