Date based versioning
Hi
I have a versioning policy which is basically:
1.year.month.build
For example:
1.2015.4.76
The autoincrementing build number is done with
{build}
, but is it possible to somehow use variables
for the year and month as well?
/J
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
Support Staff 1 Posted by Feodor Fitsner on 07 Apr, 2015 05:37 PM
Hi Jonas,
You can use Update build API in
init
section of your build. Something like:2 Posted by jonas.rapp on 07 Apr, 2015 05:44 PM
Thanks!
Now, as a clomplete newbie to both AppVeyor and yaml - is that something I can write in the Settings / Build Version Format field, or does it have to be done with some yaml magic?
Support Staff 3 Posted by Feodor Fitsner on 07 Apr, 2015 05:46 PM
You can't use date parts in version format.
There is no yaml magic - it's PowerShell magic :) and you can put the same command to "Init script" field on UI (and choosing
PS
as script type):4 Posted by jonas.rapp on 07 Apr, 2015 05:52 PM
Ah - I think I got it :)
And then I leave the Build Version Format field blank, or is it overwritten anyway by the init script?
Support Staff 5 Posted by Feodor Fitsner on 07 Apr, 2015 05:58 PM
Yes, it will be overwritten, but do not leave it blank - put just
{build}
there.6 Posted by jonas.rapp on 15 Apr, 2015 10:44 AM
Hi again
I have probably just missed something really stupid, but when I was going to adopt this to my next project, I get the following error during build:
I just don't get it...
7 Posted by jonas.rapp on 15 Apr, 2015 10:59 AM
Another thing noted:
In the previous project version is good, e.g. 1.2015.4.34 etc.The build version shown in the build history is
But the settings are identical in the two projects.
yaml from the new project:
Support Staff 8 Posted by Feodor Fitsner on 15 Apr, 2015 06:08 PM
Obviously, you can't put anything into
AssemblyVersion
andAssemblyFileVersion
attributes. They only accept the value in the forma.b.c.d
. Use just something like1.{build}
there.9 Posted by jonas.rapp on 15 Apr, 2015 06:58 PM
Obviously, no that is not a proper format.
What I meant was that using the same settings, I don't understand why the two projects behave differently.
When the first project generates a version like
1.2015.4.37
and the second, using the same settings, generates a version like1.2015.4.$5
.And why the first projects build is named
1.2015.4.37
when the second project is named5.master.
I was just looking for clues to why they behave differently using the same settings, if You might have any idea.
Support Staff 10 Posted by Feodor Fitsner on 15 Apr, 2015 07:00 PM
Ah, I see what you mean :) Assembly patching can automatically strip the suffix in versions of format
a.b.c-suffix
11 Posted by jonas.rapp on 15 Apr, 2015 07:07 PM
Great :)
But is there a way to explain why this does not work?
Because now I can't get it to work.
Working yaml:
Not working yaml:Support Staff 12 Posted by Feodor Fitsner on 15 Apr, 2015 07:13 PM
Don't see any difference in terms of setting version number.
Try outputting it into build console with:
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:55 AM.