Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 49c05ea

Browse files
committed
Add a way to override the prerelease label
This is different from `PREVIEW_LABEL`, which is used to control the type of rerelease (such as preview, beta or rc). It will still include the build number from CI. The `PRERELEASE_OVERRIDE` is the entire value after the `-`.
1 parent 7eb2580 commit 49c05ea

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ variables:
44
XCODE_VERSION: 10.1
55
VERBOSITY: minimal
66
BUILD_NUMBER: $[counter('$(Build.SourceBranchName)_counter', 1)]
7+
PREVIEW_LABEL: 'preview'
8+
PRERELEASE_OVERRIDE: ''
79

810
resources:
911
repositories:

build.cake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var BUILD_NUMBER = EnvironmentVariable("BUILD_NUMBER") ?? "";
5353
if (string.IsNullOrEmpty(BUILD_NUMBER)) {
5454
BUILD_NUMBER = "0";
5555
}
56+
var PRERELEASE_OVERRIDE = EnvironmentVariable("PRERELEASE_OVERRIDE") ?? "";
5657

5758
Information ("MONODROID_BASE_PATH: {0}", MONODROID_BASE_PATH);
5859
Information ("MONODROID_PATH: {0}", MONODROID_PATH);
@@ -140,7 +141,10 @@ Task("nuget")
140141
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
141142
c.Properties.Add("DesignTimeBuild", new [] { "false" });
142143
c.Properties.Add("AndroidSdkBuildToolsVersion", new [] { "28.0.3" });
143-
c.Properties.Add("PackageVersionSuffix", new [] { "-" + PREVIEW_LABEL + "." + BUILD_NUMBER });
144+
var pre = string.IsNullOrEmpty(PRERELEASE_OVERRIDE)
145+
? $"{PREVIEW_LABEL}.{BUILD_NUMBER}"
146+
: $"{PRERELEASE_OVERRIDE}"
147+
c.Properties.Add("PackageVersionSuffix", new [] { "-" + pre });
144148
});
145149

146150
var xmlns = (XNamespace)"http://schemas.microsoft.com/developer/msbuild/2003";

0 commit comments

Comments
 (0)