OSDN Git Service

releaseブランチをAppVeyorのビルド対象から除外する
[opentween/open-tween.git] / appveyor.yml
1 version: 2.6.0.{build}
2
3 os: Visual Studio 2022
4
5 environment:
6   matrix:
7     - RELEASE_TAG: 'false'
8     - RELEASE_TAG: 'true'
9
10 configuration:
11   - Debug
12   - Release
13
14 matrix:
15   exclude:
16     - RELEASE_TAG: 'false'
17       configuration: Release
18     - RELEASE_TAG: 'true'
19       configuration: Debug
20
21 branches:
22   only:
23     - develop
24     - /^OpenTween.+/ # release tag
25
26 for:
27   - # for dev build
28     matrix:
29       only:
30         - RELEASE_TAG: 'false'
31     skip_tags: true
32     assembly_info:
33       patch: true
34       file: OpenTween\Properties\AssemblyInfo.cs
35       assembly_version: '{version}'
36     artifacts:
37       - name: OpenTween.zip
38         path: OpenTween_dev-$(APPVEYOR_BUILD_NUMBER).zip
39   - # for release build
40     matrix:
41       only:
42         - RELEASE_TAG: 'true'
43     skip_non_tags: true
44     artifacts:
45       - name: OpenTween.zip
46         path: $(APPVEYOR_REPO_TAG_NAME).zip
47
48 build:
49   project: OpenTween.sln
50   verbosity: minimal
51
52 cache:
53   - '%UserProfile%\.nuget\packages -> OpenTween\OpenTween.csproj, OpenTween.Tests\OpenTween.Tests.csproj'
54
55 init:
56   - git config --global core.autocrlf true
57
58 before_build:
59   - nuget restore
60
61 test_script:
62   - cmd: |
63       set altCoverVersion=8.2.837
64       set xunitVersion=2.4.1
65       set targetFramework=net472
66       set nugetPackages=%UserProfile%\.nuget\packages
67
68       %nugetPackages%\altcover\%altCoverVersion%\tools\%targetFramework%\AltCover.exe --inputDirectory .\OpenTween.Tests\bin\%CONFIGURATION%\%targetFramework%\ --outputDirectory .\__Instrumented\ --assemblyFilter "?^OpenTween(?!\.Tests)" --typeFilter "?^OpenTween\." --fileFilter "\.Designer\.cs" --visibleBranches
69
70       %nugetPackages%\altcover\%altCoverVersion%\tools\%targetFramework%\AltCover.exe runner --recorderDirectory .\__Instrumented\ --executable %nugetPackages%\xunit.runner.console\%xunitVersion%\tools\%targetFramework%\xunit.console.exe -- .\__Instrumented\OpenTween.Tests.dll
71
72 after_test:
73   - ps: |
74       Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
75       .\codecov.exe -f coverage.xml
76   - ps: |
77       $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\'
78       $binDir = '.\OpenTween\bin\' + $env:CONFIGURATION + '\'
79       $objDir = '.\OpenTween\obj\' + $env:CONFIGURATION + '\'
80       $assemblyInfo = '.\OpenTween\Properties\AssemblyInfo.cs'
81       if ($env:RELEASE_TAG -eq 'true') {
82         $destPath = $env:APPVEYOR_REPO_TAG_NAME + '.zip'
83       } else {
84         $destPath = 'OpenTween_dev-' + $env:APPVEYOR_BUILD_NUMBER + '.zip'
85       }
86       .\tools\build-zip-archive.ps1 -BinDir $binDir -ObjDir $objDir -AssemblyInfo $assemblyInfo -DestPath $destPath
87
88 # vim: et fenc=utf-8 sts=2 sw=2 ts=2