WIP on the build versioning for the Updater #1460 #865

pull/1510/head
Jamie.Rees 7 years ago
parent 9a3e324265
commit 4a0e01054a

@ -0,0 +1 @@
next-version: 3.0.0

@ -1,12 +1,6 @@
version: 3.0.{build}
configuration: Release
os: Visual Studio 2015
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}-$(APPVEYOR_REPO_BRANCH)'
package_version: '{version}'
environment:
nodejs_version: "7.8.0"
@ -35,6 +29,8 @@ after_build:
#cache:
#- '%USERPROFILE%\.nuget\packages'
deploy:
- provider: GitHub
release: Ombi v$(appveyor_build_version)

@ -1,14 +1,16 @@
#tool "xunit.runner.console"
#tool "nuget:?package=GitVersion.CommandLine"
#addin "Cake.Gulp"
#addin "Cake.Npm"
#addin "SharpZipLib"
#addin "Cake.Compression"
#addin "Cake.Incubator"
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var target = Argument("target", "Build");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
@ -22,13 +24,13 @@ var projDir = "./src/"; // Project Directory
var webProjDir = "./src/Ombi";
var csProj = "./src/Ombi/Ombi.csproj"; // Path to the project.csproj
var solutionFile = "Ombi.sln"; // Solution file if needed
GitVersion versionInfo = null;
var buildSettings = new DotNetCoreBuildSettings
{
Framework = "netcoreapp1.1",
Configuration = "Release",
OutputDirectory = Directory(buildDir),
VersionSuffix = GetVersion(),
};
var publishSettings = new DotNetCorePublishSettings
@ -36,7 +38,6 @@ var publishSettings = new DotNetCorePublishSettings
Framework = "netcoreapp1.1",
Configuration = "Release",
OutputDirectory = Directory(buildDir),
VersionSuffix = GetVersion(),
};
var artifactsFolder = buildDir + "/netcoreapp1.1/";
@ -47,19 +48,7 @@ var debianArtifactsFolder = artifactsFolder + "debian.8-x64/published";
var centosArtifactsFolder = artifactsFolder + "centos.7-x64/published";
//////////////////////////////////////////////////////////////////////
// Helper
//////////////////////////////////////////////////////////////////////
public string GetVersion()
{
if (AppVeyor.IsRunningOnAppVeyor) {
// Update the version
return AppVeyor.Environment.Build.Version;
//AppVeyor.Environment.Repository.Branch;
}
return "3.0.100";
}
//////////////////////////////////////////////////////////////////////
// TASKS
@ -69,13 +58,35 @@ Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
CleanDirectory(nodeModulesDir);
//CleanDirectory(nodeModulesDir);
CleanDirectory(wwwRootDistDir);
});
Task("Restore")
Task("SetVersionInfo")
.IsDependentOn("Clean")
.IsDependentOn("Gulp Publish")
.Does(() =>
{
var settings = new GitVersionSettings {
RepositoryPath = ".",
};
if (AppVeyor.IsRunningOnAppVeyor) {
settings.Branch = AppVeyor.Environment.Repository.Branch;
} else {
settings.Branch = "master";
}
versionInfo = GitVersion(settings);
Information("GitResults -> {0}", versionInfo.Dump());
buildSettings.ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.BuildMetaData);
publishSettings.ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.BuildMetaData);
});
Task("Restore")
.IsDependentOn("SetVersionInfo")
//.IsDependentOn("Gulp Publish")
.Does(() =>
{
DotNetCoreRestore(projDir);
@ -123,9 +134,9 @@ Task("Package")
Task("Publish")
.IsDependentOn("Build")
.IsDependentOn("Publish-Windows")
.IsDependentOn("Publish-OSX").IsDependentOn("Publish-Ubuntu").IsDependentOn("Publish-Debian").IsDependentOn("Publish-Centos")
.IsDependentOn("Package");
.IsDependentOn("Publish-Windows");
//.IsDependentOn("Publish-OSX").IsDependentOn("Publish-Ubuntu").IsDependentOn("Publish-Debian").IsDependentOn("Publish-Centos")
//.IsDependentOn("Package");
Task("Publish-Windows")
.Does(() =>

@ -5,9 +5,9 @@
<RuntimeIdentifiers>win10-x64;osx.10.12-x64;ubuntu.16.04-x64;debian.8-x64;centos.7-x64;</RuntimeIdentifiers>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TypeScriptToolsVersion>2.3</TypeScriptToolsVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<Version></Version>
<AssemblyVersion>$(SemVer)</AssemblyVersion>
<FileVersion>$(SemVer)</FileVersion>
<Version>$(SemVer)</Version>
<PackageVersion></PackageVersion>
</PropertyGroup>

Loading…
Cancel
Save