Imrpove AppVeyor versioning

This commit is contained in:
AeonLucid committed 2020-10-24 20:05:23 +02:00
1 parent 880826bc20
commit 2ff01c599a
8 files changed
+33 -30

No files matched your search

+1
View File
@@ -2,4 +2,5 @@
/build
/.vs
/src/Impostor.Plugins.Debugger/Properties/launchSettings.json
/tools
+6 -11
View File
@@ -1,4 +1,8 @@
version: '1.1.{build}'
version: '{build}'
environment:
IMPOSTOR_VERSION: '1.1.0'
DOTNET_CLI_TELEMETRY_OPTOUT: 1
branches:
except:
@@ -11,19 +15,10 @@ assembly_info:
patch: false
dotnet_csproj:
patch: true
file: '**\*.csproj;**\*.props'
version: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
patch: false
image: Visual Studio 2019 Preview
environment:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
install:
- git submodule update --init --recursive
- ps: dotnet tool restore
+24 -8
View File
@@ -1,18 +1,26 @@
var buildVersion = EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? "1.0.0";
#addin "nuget:?package=Cake.FileHelpers&Version=3.3.0"
var buildId = EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? "0";
var buildVersion = EnvironmentVariable("IMPOSTOR_VERSION") ?? "1.0.0";
var buildBranch = EnvironmentVariable("APPVEYOR_REPO_BRANCH") ?? "dev";
var buildDir = MakeAbsolute(Directory("./build"));
var branch = EnvironmentVariable("APPVEYOR_REPO_BRANCH") ?? "dev";
var prNumber = EnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER");
var target = Argument("target", "Deploy");
var configuration = Argument("configuration", "Release");
// On any branch that is not master, we need to tag the version as prerelease.
if (buildBranch != "master") {
buildVersion = buildVersion + "-ci." + buildId;
}
//////////////////////////////////////////////////////////////////////
// UTILS
//////////////////////////////////////////////////////////////////////
public void ImpostorPublish(string name, string project, string runtime) {
var projBuildDir = buildDir.Combine(name + "-" + runtime);
var projBuildZip = buildDir.CombineWithFilePath(name + "-" + buildVersion + "-" + runtime + ".zip");
var projBuildDir = buildDir.Combine(name + "_" + runtime);
var projBuildZip = buildDir.CombineWithFilePath(name + "_" + buildVersion + "_" + runtime + ".zip");
DotNetCorePublish(project, new DotNetCorePublishSettings {
Configuration = configuration,
@@ -30,8 +38,8 @@ public void ImpostorPublish(string name, string project, string runtime) {
public void ImpostorPublishNF(string name, string project) {
var runtime = "win-x64";
var projBuildDir = buildDir.Combine(name + "-" + runtime);
var projBuildZip = buildDir.CombineWithFilePath(name + "-" + buildVersion + "-" + runtime + ".zip");
var projBuildDir = buildDir.Combine(name + "_" + runtime);
var projBuildZip = buildDir.CombineWithFilePath(name + "_" + buildVersion + "_" + runtime + ".zip");
DotNetCorePublish(project, new DotNetCorePublishSettings {
Configuration = configuration,
@@ -62,8 +70,16 @@ Task("Restore")
DotNetCoreRestore("./src/Impostor.Patcher/Impostor.Patcher.WinForms/Impostor.Patcher.WinForms.csproj");
});
Task("Patch")
.WithCriteria(BuildSystem.AppVeyor.IsRunningOnAppVeyor)
.Does(() => {
ReplaceRegexInFiles("./src/**/*.csproj", @"<Version>.*?<\/Version>", "<Version>" + buildVersion + "</Version>");
ReplaceRegexInFiles("./src/**/*.props", @"<Version>.*?<\/Version>", "<Version>" + buildVersion + "</Version>");
});
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Patch")
.IsDependentOn("Restore")
.Does(() => {
// Tests.
@@ -72,9 +88,9 @@ Task("Build")
});
// Only build artifacts if;
// - branch is master/dev
// - buildBranch is master/dev
// - it is not a pull request
if ((branch == "master" || branch == "dev") && string.IsNullOrEmpty(prNumber)) {
if ((buildBranch == "master" || buildBranch == "dev") && string.IsNullOrEmpty(prNumber)) {
// Client.
ImpostorPublishNF("Impostor-Patcher", "./src/Impostor.Patcher/Impostor.Patcher.WinForms/Impostor.Patcher.WinForms.csproj");
+1 -1
View File
@@ -2,11 +2,11 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<DebugType Condition=" '$(Configuration)' == 'Release' ">None</DebugType>
<CodeAnalysisRuleSet>ProjectRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>9</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -4,7 +4,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>HAZEL_BAG</DefineConstants>
<DebugType Condition=" '$(Configuration)' == 'Release' ">None</DebugType>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
@@ -6,10 +6,6 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Impostor.Patcher.Shared\Impostor.Patcher.Shared.csproj" />
</ItemGroup>
@@ -12,10 +12,6 @@
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Impostor.Patcher.Shared\Impostor.Patcher.Shared.csproj" />
<PackageReference Include="System.Resources.Extensions" Version="5.0.0-rc.2.20475.5" />
@@ -8,7 +8,6 @@
<TrimMode>Link</TrimMode>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<ApplicationIcon>icon.ico</ApplicationIcon>
<DebugType Condition=" '$(Configuration)' == 'Release' ">None</DebugType>
<CodeAnalysisRuleSet>ProjectRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>