@@ -92,21 +92,24 @@ module Versioning =
9292 | None -> NoChange( Current = AnchoredVersion currentVersion)
9393 | Some v -> Update( New = AnchoredVersion v, Old = AnchoredVersion currentVersion)
9494
95+ let WriteVersion version =
96+ match version with
97+ | NoChange _ -> failwithf " cannot run update versions because no explicit version number was passed on the command line"
98+ | Update ( newVersion, currentVersion) ->
99+ match newVersion.Full.PreRelease with
100+ | Some v when v.Name.StartsWith( " SNAPSHOT" , StringComparison.OrdinalIgnoreCase) ->
101+ printfn " Building snapshot, foregoing persisting version information"
102+ | _ ->
103+ // fail if current is greater than the new version
104+ if ( currentVersion > newVersion) then
105+ failwithf " Can not release %O as it's lower then current %O " newVersion.Full currentVersion.Full
106+ writeVersionIntoGlobalJson newVersion.Full
107+ writeVersionIntoAutoLabel ( currentVersion.Full.ToString()) ( newVersion.Full.ToString())
108+
95109 let Validate target version =
96110 match ( target, version) with
97111 | ( " release" , version) ->
98- match version with
99- | NoChange _ -> failwithf " cannot run release because no explicit version number was passed on the command line"
100- | Update ( newVersion, currentVersion) ->
101- match newVersion.Full.PreRelease with
102- | Some v when v.Name.StartsWith( " SNAPSHOT" , StringComparison.OrdinalIgnoreCase) ->
103- printfn " Building snapshot, foregoing persisting version information"
104- | _ ->
105- // fail if current is greater than the new version
106- if ( currentVersion > newVersion) then
107- failwithf " Can not release %O as it's lower then current %O " newVersion.Full currentVersion.Full
108- writeVersionIntoGlobalJson newVersion.Full
109- writeVersionIntoAutoLabel ( currentVersion.Full.ToString()) ( newVersion.Full.ToString())
112+ WriteVersion version
110113 | _ -> ignore()
111114
112115 let ArtifactsVersion buildVersions =
0 commit comments