appveyor.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. version: '{build}'
  2. image:
  3. - Visual Studio 2019
  4. - Ubuntu
  5. environment:
  6. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  7. DOTNET_CLI_TELEMETRY_OPTOUT: true
  8. APPVEYOR_YML_DISABLE_PS_LINUX: false
  9. BUILD_SUFFIX: ""
  10. VERSION_SUFFIX: ""
  11. configuration: Release
  12. pull_requests:
  13. do_not_increment_build_number: true
  14. nuget:
  15. disable_publish_on_pr: true
  16. branches:
  17. only:
  18. - master
  19. - /\d*\.\d*\.\d*/
  20. init:
  21. # Good practise, because Windows line endings are different from Unix/Linux ones
  22. - ps: git config --global core.autocrlf true
  23. - ps: $commitHash = $($env:APPVEYOR_REPO_COMMIT.substring(0,7));
  24. - ps: $branch = $env:APPVEYOR_REPO_BRANCH;
  25. - ps: $buildNumber = $env:APPVEYOR_BUILD_NUMBER;
  26. - ps: $isRepoTag = $env:APPVEYOR_REPO_TAG;
  27. - ps: $revision = $(If ($isRepoTag -eq "true") {[string]::Empty} Else {"{0:00000}" -f [convert]::ToInt32("0" + $buildNumber, 10)});
  28. - ps: $suffix = $(If ([string]::IsNullOrEmpty($revision)) {[string]::Empty} Else {$branch.Substring(0, [math]::Min(10,$branch.Length))});
  29. - ps: $env:BUILD_SUFFIX = $(If ([string]::IsNullOrEmpty($suffix)) {"$branch-$commitHash"} Else {"$suffix-$commitHash"});
  30. - ps: $env:VERSION_SUFFIX = $(If ([string]::IsNullOrEmpty($suffix)) {[string]::Empty} Else {"--version-suffix=$suffix"});
  31. install:
  32. - ps: dotnet restore redmine-net-api.sln
  33. before_build:
  34. - ps: write-host "Is repo tag = $isRepoTag" -foregroundcolor Green
  35. - ps: write-host "Build number = $buildNumber" -foregroundcolor Magenta
  36. - ps: write-host "Branch = $branch" -foregroundcolor DarkYellow
  37. - ps: write-host "Revision = $revision" -foregroundcolor Cyan
  38. - ps: write-host "Build suffix = $env:BUILD_SUFFIX" -foregroundcolor Yellow
  39. - ps: write-host "Version suffix = $env:VERSION_SUFFIX" -foregroundcolor Red
  40. - ps: dotnet --version
  41. build_script:
  42. - ps: dotnet build src\redmine-net-api\redmine-net-api.csproj -c Release --version-suffix=$env:BUILD_SUFFIX
  43. - ps: dotnet build src\redmine-net-api\redmine-net-api.csproj -c Release --version-suffix=$env:BUILD_SUFFIX -p:Sign=true
  44. after_build:
  45. - ps: dotnet pack src\redmine-net-api\redmine-net-api.csproj -c Release --output .\artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build $env:VERSION_SUFFIX
  46. - ps: dotnet pack src\redmine-net-api\redmine-net-api.csproj -c Release --output .\artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build $env:VERSION_SUFFIX -p:Sign=true
  47. test: off
  48. artifacts:
  49. - name: NuGet Packages
  50. path: .\artifacts\**\*.nupkg
  51. - name: NuGet Symbol Packages
  52. path: .\artifacts\**\*.snupkg
  53. skip_commits:
  54. files:
  55. - '**/*.md'
  56. - '**/*.gif'
  57. - '**/*.png'
  58. - LICENSE
  59. - tests/*
  60. for:
  61. -
  62. matrix:
  63. only:
  64. - image: Ubuntu
  65. deploy:
  66. - provider: NuGet
  67. name: production
  68. api_key:
  69. secure: fEZylRkHvyJqjgeQ+i9TfL/JOPjLKr43k+a8Oy5MIy54IkFC8ZECaEfskcWOyqcg
  70. skip_symbols: true
  71. on:
  72. APPVEYOR_REPO_TAG: true