OSDN Git Service

WebRequestHandler.ReadWriteTimeoutの設定漏れを修正
[opentween/open-tween.git] / appveyor.yml
index 32946ee..6d75fa4 100644 (file)
@@ -1,24 +1,91 @@
-version: 1.2.8.{build}
+version: 3.8.0.{build}
 
-os: Visual Studio 2015
+os: Visual Studio 2022
 
-assembly_info:
-  patch: true
-  file: OpenTween\Properties\AssemblyInfo.cs
-  assembly_file_version: '{version}'
+environment:
+  matrix:
+    - RELEASE_TAG: 'false'
+    - RELEASE_TAG: 'true'
+
+configuration:
+  - Debug
+  - Release
+
+matrix:
+  exclude:
+    - RELEASE_TAG: 'false'
+      configuration: Release
+    - RELEASE_TAG: 'true'
+      configuration: Debug
+
+branches:
+  only:
+    - develop
+    - /^OpenTween.+/ # release tag
+
+for:
+  - # for dev build
+    matrix:
+      only:
+        - RELEASE_TAG: 'false'
+    skip_tags: true
+    assembly_info:
+      patch: true
+      file: OpenTween\Properties\AssemblyInfo.cs
+      assembly_version: '{version}'
+    artifacts:
+      - name: OpenTween.zip
+        path: OpenTween_dev-$(APPVEYOR_BUILD_NUMBER).zip
+  - # for release build
+    matrix:
+      only:
+        - RELEASE_TAG: 'true'
+    skip_non_tags: true
+    artifacts:
+      - name: OpenTween.zip
+        path: $(APPVEYOR_REPO_TAG_NAME).zip
 
 build:
+  project: OpenTween.sln
   verbosity: minimal
 
-install:
-  - set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
+cache:
+  - '%UserProfile%\.nuget\packages -> OpenTween\OpenTween.csproj, OpenTween.Tests\OpenTween.Tests.csproj'
 
-after_test:
-  - del %APPVEYOR_BUILD_FOLDER%\OpenTween\bin\Debug\OpenTween.pdb
-  - 7z a OpenTween_dev-%APPVEYOR_BUILD_NUMBER%.zip %APPVEYOR_BUILD_FOLDER%\OpenTween\bin\Debug\*
+init:
+  - git config --global core.autocrlf true
 
-artifacts:
-  - name: OpenTween.zip
-    path: OpenTween_dev-$(APPVEYOR_BUILD_NUMBER).zip
+before_build:
+  - nuget restore
+
+test_script:
+  - cmd: |
+      set altCoverVersion=8.6.61
+      set xunitVersion=2.4.2
+      set targetFramework=net48
+      set nugetPackages=%UserProfile%\.nuget\packages
+
+      %nugetPackages%\altcover\%altCoverVersion%\tools\net472\AltCover.exe --inputDirectory .\OpenTween.Tests\bin\%CONFIGURATION%\%targetFramework%\ --outputDirectory .\__Instrumented\ --assemblyFilter "?^OpenTween(?!\.Tests)" --typeFilter "?^OpenTween\." --fileFilter "\.Designer\.cs" --visibleBranches
+
+      %nugetPackages%\altcover\%altCoverVersion%\tools\net472\AltCover.exe runner --recorderDirectory .\__Instrumented\ --executable %nugetPackages%\xunit.runner.console\%xunitVersion%\tools\net472\xunit.console.exe -- .\__Instrumented\OpenTween.Tests.dll
+
+after_test:
+  - ps: |
+      Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
+      .\codecov.exe -f coverage.xml
+  - ps: |
+      $env:PATH = $env:PATH + ';C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\Roslyn\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\'
+      $binDir = '.\OpenTween\bin\' + $env:CONFIGURATION + '\net48\'
+      if ($env:RELEASE_TAG -eq 'true') {
+        $destPath = $env:APPVEYOR_REPO_TAG_NAME + '.zip'
+      } else {
+        $destPath = 'OpenTween_dev-' + $env:APPVEYOR_BUILD_NUMBER + '.zip'
+      }
+      if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null) {
+        $headCommit = $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT
+      } else {
+        $headCommit = 'HEAD'
+      }
+      .\tools\build-zip-archive.ps1 -BinDir $binDir -DestPath $destPath -HeadCommit $headCommit
 
 # vim: et fenc=utf-8 sts=2 sw=2 ts=2