You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

appveyor.yml 4.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. version: build-{build}
  2. branches:
  3. only:
  4. - dev
  5. image:
  6. - Visual Studio 2017
  7. - Ubuntu
  8. nuget:
  9. disable_publish_on_pr: true
  10. pull_requests:
  11. do_not_increment_build_number: true
  12. # Use the default clone_folder
  13. # Windows: C:\Projects\discord-net
  14. # Ubuntu: /home/appveyor/projects/discord-net
  15. cache: test/Discord.Net.Tests/cache.db
  16. environment:
  17. DOTNET_CLI_TELEMETRY_OPTOUT: 1
  18. DNET_TEST_TOKEN:
  19. secure: l7h5e7UE7yRd70hAB97kjPiQpPOShwqoBbOzEAYQ+XBd/Pre5OA33IXa3uisdUeQJP/nPFhcOsI+yn7WpuFaoQ==
  20. DNET_TEST_GUILDID: 273160668180381696
  21. init:
  22. - ps: $Env:BUILD = "$($Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0"))"
  23. build_script:
  24. - ps: >-
  25. if ($isLinux)
  26. {
  27. # AppVeyor Linux images do not have appveyor-retry, which retries the commands a few times
  28. # until the command exits with code 0.
  29. # So, this is done with a short script.
  30. $code = 0
  31. $counter = 0
  32. do
  33. {
  34. dotnet restore Discord.Net.sln -v Minimal /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG"
  35. $code = $LASTEXITCODE
  36. $counter++
  37. if ($code -ne 0)
  38. {
  39. # Wait 5s before attempting to run again
  40. Start-sleep -Seconds 5
  41. }
  42. }
  43. until ($counter -eq 5 -or $code -eq 0)
  44. }
  45. else
  46. {
  47. appveyor-retry dotnet restore Discord.Net.sln -v Minimal /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG"
  48. }
  49. - ps: dotnet build Discord.Net.sln -c "Release" /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG"
  50. after_build:
  51. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.Core\Discord.Net.Core.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  52. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.Rest\Discord.Net.Rest.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  53. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  54. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.Commands\Discord.Net.Commands.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  55. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.Webhook\Discord.Net.Webhook.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  56. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.Providers.WS4Net\Discord.Net.Providers.WS4Net.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  57. - ps: if ($isWindows) { dotnet pack "src\Discord.Net.Analyzers\Discord.Net.Analyzers.csproj" -c "Release" -o "../../artifacts" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" }
  58. - ps: >-
  59. if ($isWindows)
  60. {
  61. if ($Env:APPVEYOR_REPO_TAG -eq "true") {
  62. nuget pack src/Discord.Net/Discord.Net.nuspec -OutputDirectory "artifacts" -properties suffix=""
  63. } else {
  64. nuget pack src/Discord.Net/Discord.Net.nuspec -OutputDirectory "artifacts" -properties suffix="-$Env:BUILD"
  65. }
  66. }
  67. - ps: if ($isWindows) { Get-ChildItem artifacts/*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } }
  68. test_script:
  69. - ps: >-
  70. if ($APPVEYOR_PULL_REQUEST_NUMBER -eq "") {
  71. dotnet test test/Discord.Net.Tests/Discord.Net.Tests.csproj -c "Release" --no-build /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG"
  72. }
  73. deploy:
  74. - provider: NuGet
  75. server: https://www.myget.org/F/discord-net/api/v2/package
  76. api_key:
  77. secure: Jl7BXeUjRnkVHDMBuUWSXcEOkrli1PBleW2IiLyUs5j63UNUNp1hcjaUJRujx9lz
  78. symbol_server: https://www.myget.org/F/discord-net/symbols/api/v2/package
  79. on:
  80. branch: dev
  81. CI_WINDOWS: true
  82. - provider: NuGet
  83. server: https://www.myget.org/F/rogueexception/api/v2/package
  84. api_key:
  85. secure: D+vW2O2LBf/iJb4f+q8fkyIW2VdIYIGxSYLWNrOD4BHlDBZQlJipDbNarWjUr2Kn
  86. symbol_server: https://www.myget.org/F/rogueexception/symbols/api/v2/package
  87. on:
  88. branch: dev
  89. CI_WINDOWS: true