dotnet_csproj only on tags
Hi, I'm trying to make it so when I push a tag like 0.0.2
, appveyor will patch my dotnet core assemblies with this version number. I don't want to patch the assemblies on general pushes to master
since they won't have a valid version number.
My general approach is to use the for:
statement like so:
for:
-
# only for git-tagged releases...
matrix:
only:
- APPVEYOR_REPO_TAG: true
dotnet_csproj:
patch: true
file: '**\*.csproj'
assembly_version: '{appveyor_repo_tag_name}'
informational_version: '{appveyor_repo_tag_name}'
file_version: '{version} ({branch})'
I've also tried the following branches
filter:
for:
-
# only for git-tagged releases...
branches:
only:
- /\d\.\d\.\d/
dotnet_csproj:
patch: true
file: '**\*.csproj'
assembly_version: '{appveyor_repo_tag_name}'
informational_version: '{appveyor_repo_tag_name}'
file_version: '{version} ({branch})'
However, dotnet_csproj
does not appear to trigger. I have a deploy:
statement right after the dotnet_csproj
and neither seem to be applying (I know I can use on:
inside a top-level deploy
to fix this, though).
I'm tagging the releases like:
git tag 0.0.2
git push origin 0.0.2
So annotated tags aren't coming into play here. My full appveyor.yml is on GitHub. How can I make it so dotnet_csproj
only runs for tags? Thanks!
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ilya Finkelshte... on 29 Oct, 2018 11:46 PM
This was an interesting problem :) Please check the simplified version of your YAML which should do it. There are comments inside to make it self-explainable, but feel free to ask any additional questions:
2 Posted by Will on 30 Oct, 2018 05:13 AM
Oh, that's great! Thank you Ilya. The comments make it very clear.
Thank you also for the tips about
version
and the msbuild syntax.3 Posted by Ilya Finkelshte... on 30 Oct, 2018 06:00 PM
Sure, feel free to ping any time :)
Ilya Finkelshteyn closed this discussion on 30 Oct, 2018 06:00 PM.