version: '1.0.{build}'

configuration:
- Release

platform: Any CPU

branches:
  only:
  - master

environment:
  # Don't report back to the mothership
    DOTNET_CLI_TELEMETRY_OPTOUT: 1

init:
- ps: $Env:LABEL = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")

before_build:
- appveyor-retry dotnet restore -v Minimal

assembly_info:
  patch: true
  file: AssemblyInfo.cs
  assembly_version: '{version}'
  assembly_file_version: '{version}'
  assembly_informational_version: '{version}'
  
build_script:
- ps: src\dotnet-make\update_version.ps1
- dotnet build "src\dotnet-make" -c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%

after_build:
- dotnet pack "src\dotnet-make" -c Release

test_script:

artifacts:
  - path: '**\*.nupkg'
    name: NuGet package

deploy:
  provider: NuGet
  api_key:
    secure: 2yGf9wWYVIETYfooKme+gT7pKIbw94M2iwnMBZLlsZR5abhhBp6xpmsaIrodL1eC
  skip_symbols: true
  artifact: /.*\.nupkg/

cache:
- '%USERPROFILE%\.nuget\packages'

on_finish:

version: '1.0.{build}'

configuration:
- Release

platform: Any CPU

branches:
  only:
  - master

environment:
  # Don't report back to the mothership
    DOTNET_CLI_TELEMETRY_OPTOUT: 1

init:
- ps: $Env:LABEL = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")

before_build:
- appveyor-retry dotnet restore -v Minimal

assembly_info:
  patch: true
  file: AssemblyInfo.cs
  assembly_version: '{version}'
  assembly_file_version: '{version}'
  assembly_informational_version: '{version}'
  
build_script:
- ps: C:\Projects\dotnet-make\src\dotnet-make\update_version.ps1
- dotnet build "src\dotnet-make" -c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%

after_build:
- dotnet pack "src\dotnet-make" -c Release

test_script:

artifacts:
  - path: '**\*.nupkg'
    name: NuGet package

deploy:
  provider: NuGet
  api_key:
    secure: 2yGf9wWYVIETYfooKme+gT7pKIbw94M2iwnMBZLlsZR5abhhBp6xpmsaIrodL1eC
  skip_symbols: true
  artifact: /.*\.nupkg/

cache:
- '%USERPROFILE%\.nuget\packages'

on_finish:

Fix - Run powershell script.
Fix - Run powershell script.
