这个周末我开始玩AppVeyor了。在我解决了其他一些问题之后,我目前还停留在版本修补上。
我试图实现的目标:我的普通主分支应该像1.0.{build}这样的版本,它工作得很好。但是当涉及到开发分支时,每个构建(或者说nuget包)都应该包括类似于"-alpha“后缀的东西。
这是我当前的Appveyor.xml
。它当前提交到我的dev-Branch的根目录,master分支当前没有xml,我想先修复这个问题。
version: 1.0.{build}
image: Visual Studio 2017
configuration: Release
platform: Any CPU
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{build}'
informational_version: '{version}'
before_build:
- cmd: dotnet restore Kinoheld.Api.Client\Kinoheld.Api.Client.sln
build:
verbosity: minimal
after_build:
- cmd: dotnet pack Kinoheld.Api.Client\Kinoheld.Api.Client\Kinoheld.Api.Client.csproj
artifacts:
- path: '**\*.nupkg'
deploy: off
for:
-
branches:
only:
- dev
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}-alpha'
package_version: '{version}-alpha'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version} (pre-release)'
为什么我的项目没有打补丁?好吧,我不知道它们是否真的没有补丁,但为什么最终的结果是我的dev-build包没有我上面指定的版本?我是不是漏掉了什么?也许在我的csproj文件或类似的东西中?
你可以在这里找到我的项目开发分支- https://github.com/janniksam/Kinoheld/tree/dev -随时查看它,如果你需要比上面的xml更多的信息。
更新:\
如果你想知道:I you not the "Ignore appveyor.yml“。我在控制台中看到行Patching .NET Core .csproj files
。
发布于 2018-09-23 19:02:46
我终于找到了解决方案。当涉及到查找项目时,Appveyor会在项目中搜索属性<Version>
。我的项目没有声明<Version>
。
https://stackoverflow.com/questions/52465213
复制相似问题