是否可以让AppVeyor构建使用csproj文件中的构建号,但用{build}
变量替换'patch'版本?
例如:
CSPROJ: <Version>2.1.0</Version>
AppVeyor: ??? What goes here? Manually setting 2.1.{build} will work but then to rev to 2.2, we have to update appveyor AND csproj.
Output: 2.1.15 (assuming build number is 15)
内置的AppVeyor修补系统可以做到吗?
答案 0 :(得分:1)
这应该有效。只需替换$xmlPath
install:
- ps: |
$xmlPath = "$env:appveyor_build_folder\mysubfolder\myproject.csproj"
$xml = [xml](get-content $xmlPath)
$version = ($xml.Project.PropertyGroup | ? {$_.Version}).Version
$env:newversion = ($version.Substring(0, $version.LastIndexOf(".") + 1)) + $env:appveyor_build_number
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: $(newversion)
package_version: $(newversion)
assembly_version: $(newversion)
file_version: $(newversion)
informational_version: $(newversion)