parameters:
  netcore1Global: true

steps:
- task: DotNetCoreCLI@2
  displayName: dotnet build
  inputs:
    command: build
    projects: msgpack.sln
    arguments: -c Release
    verbosityRestore: minimal

- task: Bash@3
  displayName: set version variable
  inputs:
    targetType: inline
    script: echo "##vso[task.setvariable variable=NugetPackageVersion]$(git describe --tags | sed 's/-/./')"

- task: Bash@3
  displayName: pack nuget package
  inputs:
    targetType: inline
    script: dotnet pack --no-build -v minimal -c Release /property:Version=$NugetPackageVersion /property:PackageOutputPath=$(Build.ArtifactStagingDirectory)

- template: test.yml
  parameters:
    path: tests/msgpack.light.tests/msgpack.light.tests.csproj
    framework: netcoreapp1.0
    frameworkGlobal: ${{ parameters.netcore1Global }}

- template: test.yml
  parameters:
    path: tests/msgpack.light.tests/msgpack.light.tests.csproj
    framework: netcoreapp1.1
    frameworkGlobal: ${{ parameters.netcore1Global }}

- template: test.yml
  parameters:
    path: tests/msgpack.light.tests/msgpack.light.tests.csproj
    framework: netcoreapp2.0

parameters:
  netcore1Global: true

steps:
- task: DotNetCoreCLI@2
  displayName: dotnet build
  inputs:
    command: build
    projects: msgpack.sln
    arguments: -c Release
    verbosityRestore: minimal

- task: Bash@3
  displayName: pack nuget package
  inputs:
    targetType: inline
    script: dotnet pack --no-build -v minimal -c Release /property:Version=$(git describe --tags | sed 's/-/./') /property:PackageOutputPath=$(Build.ArtifactStagingDirectory)

- template: test.yml
  parameters:
    path: tests/msgpack.light.tests/msgpack.light.tests.csproj
    framework: netcoreapp1.0
    frameworkGlobal: ${{ parameters.netcore1Global }}

- template: test.yml
  parameters:
    path: tests/msgpack.light.tests/msgpack.light.tests.csproj
    framework: netcoreapp1.1
    frameworkGlobal: ${{ parameters.netcore1Global }}

- template: test.yml
  parameters:
    path: tests/msgpack.light.tests/msgpack.light.tests.csproj
    framework: netcoreapp2.0

Move calculation of version inline to script.
Move calculation of version inline to script.
