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 5.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. # Notes:
  2. # - Minimal appveyor.yml file is an empty file. All sections are optional.
  3. # - Indent each level of configuration with 2 spaces. Do not use tabs!
  4. # - All section names are case-sensitive.
  5. # - Section names should be unique on each level.
  6. #---------------------------------#
  7. # general configuration #
  8. #---------------------------------#
  9. # version format
  10. # Build version format is taken from UI if it is not set
  11. # version: 1.0.{build}
  12. # # branches to build
  13. # branches:
  14. # # whitelist
  15. # only:
  16. # - master
  17. # - production
  18. # # blacklist
  19. # except:
  20. # - gh-pages
  21. #---------------------------------#
  22. # environment configuration #
  23. #---------------------------------#
  24. # Build worker image (VM template)
  25. image: Visual Studio 2017
  26. # scripts that are called at very beginning, before repo cloning
  27. # init:
  28. # - git config --global core.autocrlf false
  29. # set clone depth
  30. clone_depth: 5 # clone entire repository history if not defined
  31. # environment variables
  32. environment:
  33. # my_var1: value1
  34. # # this is how to set encrypted variable. Go to "Settings" -> "Encrypt YAML" page in account menu to encrypt data.
  35. # my_secure_var1:
  36. # secure: FW3tJ3fMncxvs58/ifSP7w==
  37. matrix:
  38. - platform: x86
  39. configuration: Debug
  40. - platform: x86
  41. configuration: Release
  42. # this is how to allow failing jobs in the matrix
  43. matrix:
  44. fast_finish: false # set this flag to immediately finish build once one of the jobs fails.
  45. # build cache to preserve files/folders between builds
  46. cache:
  47. - packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
  48. # - '%LocalAppData%\NuGet\Cache' # NuGet < v3
  49. - '%LocalAppData%\NuGet\v3-cache' # NuGet v3
  50. # Automatically register private account and/or project AppVeyor NuGet feeds.
  51. # nuget:
  52. # account_feed: true
  53. # project_feed: true
  54. # disable_publish_on_pr: true # disable publishing of .nupkg artifacts to account/project feeds for pull request builds
  55. # publish_wap_octopus: true # disable publishing of Octopus Deploy .nupkg artifacts to account/project feeds
  56. #---------------------------------#
  57. # build configuration #
  58. #---------------------------------#
  59. # Build settings, not to be confused with "before_build" and "after_build".
  60. # "project" is relative to the original build directory and not influenced by directory changes in "before_build".
  61. build:
  62. # parallel: true # enable MSBuild parallel builds
  63. # publish_nuget: true # package projects with .nuspec files and push to artifacts
  64. # publish_nuget_symbols: true # generate and publish NuGet symbol packages
  65. # include_nuget_references: true # add -IncludeReferencedProjects option while packaging NuGet artifacts
  66. # MSBuild verbosity level
  67. verbosity: normal # quiet|minimal|normal|detailed
  68. # scripts to run before build
  69. before_build:
  70. - cmd: nuget restore
  71. # to run your custom scripts instead of automatic MSBuild
  72. # build_script:
  73. # scripts to run after build (working directory and environment changes are persisted from the previous steps)
  74. after_build:
  75. - ps: |+
  76. function CalculateHash($file)
  77. {
  78. $newLine = "`r`n"
  79. $text = (Split-Path $file -Leaf) + $newLine
  80. $text += 'MD5' + $newLine
  81. $text += (Get-FileHash $file -Algorithm MD5).Hash + $newLine
  82. $text += 'SHA-1' + $newLine
  83. $text += (Get-FileHash $file -Algorithm SHA1).Hash + $newLine
  84. $text += 'SHA-256' + $newLine
  85. $text += (Get-FileHash $file -Algorithm SHA256).Hash + $newLine
  86. $text += 'SHA-512' + $newLine
  87. $text += (Get-FileHash $file -Algorithm SHA512).Hash
  88. return $text
  89. }
  90. $WorkingFolder = "$env:APPVEYOR_BUILD_FOLDER\working"
  91. $ExeFileName = "Shadowsocks-$env:APPVEYOR_BUILD_VERSION-$env:CONFIGURATION.exe"
  92. $ExeFile = "$WorkingFolder\$ExeFileName"
  93. $ExeHashFile = "$Exefile.hash"
  94. New-Item "$WorkingFolder" -ItemType Directory -Force
  95. Copy-Item "$env:APPVEYOR_BUILD_FOLDER\shadowsocks-csharp\bin\$env:PLATFORM\$env:CONFIGURATION\Shadowsocks.exe" "$WorkingFolder\Shadowsocks.exe"
  96. Copy-Item "$WorkingFolder\Shadowsocks.exe" "$ExeFile"
  97. CalculateHash -file "$Exefile" | Out-File -FilePath "$ExeHashFile"
  98. Push-AppveyorArtifact "$ExeFile"
  99. Push-AppveyorArtifact "$ExeHashFile"
  100. # Create and deploy the release zip
  101. $ReleaseFile = "$WorkingFolder\Shadowsocks.exe"
  102. $ReleaseHashFile = "$ReleaseFile.hash"
  103. $ZipFile = "$WorkingFolder\Shadowsocks-$env:APPVEYOR_BUILD_VERSION.zip"
  104. $ZipHashFile = "$ZipFile.hash"
  105. # Calculate exe Hash and archieve both exe and hash to zip
  106. CalculateHash -file "$ReleaseFile" | Out-File -FilePath "$ReleaseHashFile"
  107. 7z a "$ZipFile" "$ReleaseFile" "$ReleaseHashFile"
  108. Push-AppveyorArtifact "$ZipFile"
  109. # Calculate packed zip Hash
  110. CalculateHash -file "$ZipFile" | Out-File -FilePath "$ZipHashFile"
  111. Push-AppveyorArtifact "$ZipHashFile"
  112. # scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services)
  113. # before_package:
  114. # to disable automatic builds
  115. #build: off
  116. #---------------------------------#
  117. # deployment configuration #
  118. #---------------------------------#
  119. # providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment
  120. # provider names are case-sensitive!
  121. # deploy:
  122. # # scripts to run before deployment
  123. # before_deploy:
  124. # # scripts to run after deployment
  125. # after_deploy:
  126. # # to run your custom scripts instead of provider deployments
  127. # deploy_script:
  128. # # to disable deployment
  129. #deploy: off