# Notes: # - Minimal appveyor.yml file is an empty file. All sections are optional. # - Indent each level of configuration with 2 spaces. Do not use tabs! # - All section names are case-sensitive. # - Section names should be unique on each level. #---------------------------------# # general configuration # #---------------------------------# # version format # Build version format is taken from UI if it is not set version: 4.4.0.{build} # # branches to build # branches: # # whitelist # only: # - master # - production # # blacklist # except: # - gh-pages #---------------------------------# # environment configuration # #---------------------------------# # Build worker image (VM template) image: Visual Studio 2019 # scripts that are called at very beginning, before repo cloning # init: # - git config --global core.autocrlf false # set clone depth clone_depth: 5 # clone entire repository history if not defined # environment variables environment: # my_var1: value1 # # this is how to set encrypted variable. Go to "Settings" -> "Encrypt YAML" page in account menu to encrypt data. # my_secure_var1: # secure: FW3tJ3fMncxvs58/ifSP7w== matrix: - platform: x86 configuration: Debug - platform: x86 configuration: Release # this is how to allow failing jobs in the matrix matrix: fast_finish: false # set this flag to immediately finish build once one of the jobs fails. # build cache to preserve files/folders between builds cache: - packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified # - '%LocalAppData%\NuGet\Cache' # NuGet < v3 - '%LocalAppData%\NuGet\v3-cache' # NuGet v3 # Automatically register private account and/or project AppVeyor NuGet feeds. # nuget: # account_feed: true # project_feed: true # disable_publish_on_pr: true # disable publishing of .nupkg artifacts to account/project feeds for pull request builds # publish_wap_octopus: true # disable publishing of Octopus Deploy .nupkg artifacts to account/project feeds #---------------------------------# # build configuration # #---------------------------------# # Build settings, not to be confused with "before_build" and "after_build". # "project" is relative to the original build directory and not influenced by directory changes in "before_build". build: # parallel: true # enable MSBuild parallel builds # publish_nuget: true # package projects with .nuspec files and push to artifacts # publish_nuget_symbols: true # generate and publish NuGet symbol packages # include_nuget_references: true # add -IncludeReferencedProjects option while packaging NuGet artifacts # MSBuild verbosity level verbosity: normal # quiet|minimal|normal|detailed # scripts to run before build before_build: - cmd: nuget restore # to run your custom scripts instead of automatic MSBuild # build_script: # scripts to run after build (working directory and environment changes are persisted from the previous steps) after_build: - ps: |+ function CalculateHash($file) { $newLine = "`r`n" $text = (Split-Path $file -Leaf) + $newLine $text += 'MD5' + $newLine $text += (Get-FileHash $file -Algorithm MD5).Hash + $newLine $text += 'SHA-1' + $newLine $text += (Get-FileHash $file -Algorithm SHA1).Hash + $newLine $text += 'SHA-256' + $newLine $text += (Get-FileHash $file -Algorithm SHA256).Hash + $newLine $text += 'SHA-512' + $newLine $text += (Get-FileHash $file -Algorithm SHA512).Hash return $text } $WorkingFolder = "$env:APPVEYOR_BUILD_FOLDER\shadowsocks-csharp\bin\$env:PLATFORM\$env:CONFIGURATION" $ReleaseFile = "$WorkingFolder\Shadowsocks.exe" $ReleaseHashFile = "$ReleaseFile.hash" $ReleaseLocalizationFiles = "$WorkingFolder\*\" $ZipFile = "$WorkingFolder\Shadowsocks-$env:APPVEYOR_BUILD_VERSION.zip" $ZipHashFile = "$ZipFile.hash" CalculateHash -file "$ReleaseFile" | Out-File -FilePath "$ReleaseHashFile" 7z a "$ZipFile" "$ReleaseFile" "$ReleaseHashFile" "$ReleaseLocalizationFiles" Push-AppveyorArtifact "$ZipFile" # Calculate packed zip Hash CalculateHash -file "$ZipFile" | Out-File -FilePath "$ZipHashFile" Push-AppveyorArtifact "$ZipHashFile" # scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services) # before_package: # to disable automatic builds #build: off #---------------------------------# # deployment configuration # #---------------------------------# # providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment # provider names are case-sensitive! # deploy: # # scripts to run before deployment # before_deploy: # # scripts to run after deployment # after_deploy: # # to run your custom scripts instead of provider deployments # deploy_script: # # to disable deployment #deploy: off