mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
release version
This commit is contained in:
38
build.cake
38
build.cake
@@ -11,8 +11,28 @@ var version = "version";
|
|||||||
var repoDir = "repoDir";
|
var repoDir = "repoDir";
|
||||||
var outputPath = "outputPath";
|
var outputPath = "outputPath";
|
||||||
|
|
||||||
|
string solution
|
||||||
|
{
|
||||||
|
get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln");
|
||||||
|
}
|
||||||
|
string project
|
||||||
|
{
|
||||||
|
get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj");
|
||||||
|
}
|
||||||
|
string binPath
|
||||||
|
{
|
||||||
|
get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64");
|
||||||
|
}
|
||||||
|
string manifest
|
||||||
|
{
|
||||||
|
get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest");
|
||||||
|
}
|
||||||
|
|
||||||
if (AzurePipelines.IsRunningOnAzurePipelines)
|
if (AzurePipelines.IsRunningOnAzurePipelines)
|
||||||
{
|
{
|
||||||
|
repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath;
|
||||||
|
outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath;
|
||||||
|
|
||||||
var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN");
|
var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN");
|
||||||
version = HttpGet(
|
version = HttpGet(
|
||||||
"https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion",
|
"https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion",
|
||||||
@@ -27,23 +47,18 @@ if (AzurePipelines.IsRunningOnAzurePipelines)
|
|||||||
Information($"Version: {version}");
|
Information($"Version: {version}");
|
||||||
|
|
||||||
AzurePipelines.Commands.SetVariable("version", version);
|
AzurePipelines.Commands.SetVariable("version", version);
|
||||||
|
|
||||||
repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath;
|
|
||||||
outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath;
|
|
||||||
}
|
}
|
||||||
else if (AppVeyor.IsRunningOnAppVeyor)
|
else if (AppVeyor.IsRunningOnAppVeyor)
|
||||||
{
|
{
|
||||||
// TODO: AppVeyor version
|
|
||||||
version = string.Empty;
|
|
||||||
Information("version");
|
|
||||||
|
|
||||||
repoDir = AppVeyor.Environment.Build.Folder;
|
repoDir = AppVeyor.Environment.Build.Folder;
|
||||||
outputPath = System.IO.Path.Combine(repoDir, "src", "output");
|
outputPath = System.IO.Path.Combine(repoDir, "src", "output");
|
||||||
}
|
|
||||||
|
|
||||||
var solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln");
|
version = XmlPeek(manifest, "appx:Package/appx:Identity/@Version", new XmlPeekSettings
|
||||||
var project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj");
|
{
|
||||||
var binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64");
|
Namespaces = new Dictionary<string, string> { { "appx", "http://schemas.microsoft.com/appx/manifest/foundation/windows10" } }
|
||||||
|
})[..^2];
|
||||||
|
Information($"Version: {version}");
|
||||||
|
}
|
||||||
|
|
||||||
Task("Build")
|
Task("Build")
|
||||||
.IsDependentOn("Build binary package")
|
.IsDependentOn("Build binary package")
|
||||||
@@ -69,7 +84,6 @@ Task("Generate AppxManifest")
|
|||||||
{
|
{
|
||||||
Information("Generating AppxManifest...");
|
Information("Generating AppxManifest...");
|
||||||
|
|
||||||
var manifest = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest");
|
|
||||||
var content = System.IO.File.ReadAllText(manifest);
|
var content = System.IO.File.ReadAllText(manifest);
|
||||||
|
|
||||||
if (AzurePipelines.IsRunningOnAzurePipelines)
|
if (AzurePipelines.IsRunningOnAzurePipelines)
|
||||||
|
|||||||
Reference in New Issue
Block a user