Prepare for canary build

This commit is contained in:
Kenneth Skovhede
2024-05-30 15:34:45 +02:00
parent d9174d1488
commit 1fb46d7fd2
5 changed files with 30 additions and 30 deletions
+11 -11
View File
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>license_upgrader</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>license_upgrader</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+6
View File
@@ -11,6 +11,12 @@
"preLaunchTask": "dotnet: build",
"program": "${workspaceFolder}/bin/Debug/net8.0/ReleaseBuilder.dll",
// "args": ["create-key", "testfile.key1", "--password", "test1234"],
// "args": ["build", "canary"],
// "args": ["build", "experimental"],
// "args": ["build", "beta"],
// "args": ["build", "stable"],
"args": [
"build",
"debug",
+7 -4
View File
@@ -142,6 +142,7 @@ public static partial class Command
request.Headers.Add("Accept", "application/vnd.github+json");
request.Headers.Add("Authorization", $"Bearer {ghtoken}");
request.Headers.Add("X-GitHub-Api-Version", "2022-11-28");
request.Headers.Add("User-Agent", "Duplicati Release Builder v1");
request.Content = JsonContent.Create(new GhReleaseInfo(
tag_name: $"v{rtcfg.ReleaseInfo.ReleaseName}",
target_commitish: "master",
@@ -166,10 +167,11 @@ public static partial class Command
request.Headers.Add("Accept", "application/vnd.github+json");
request.Headers.Add("Authorization", $"Bearer {ghtoken}");
request.Headers.Add("X-GitHub-Api-Version", "2022-11-28");
request.Headers.Add("Content-Type", "application/octet-stream");
request.Headers.Add("User-Agent", "Duplicati Release Builder v1");
using var fileStream = File.OpenRead(file.Path);
request.Content = new StreamContent(fileStream);
request.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
@@ -218,11 +220,12 @@ public static partial class Command
req.Headers.Add("Accept", "application/json");
req.Content = new FormUrlEncodedContent([
new KeyValuePair<string, string>("category", "10"),
new KeyValuePair<string, string>("title", $"Release: ${rtcfg.ReleaseInfo.Version} (${rtcfg.ReleaseInfo.Channel}) ${rtcfg.ReleaseInfo.Timestamp:yyyy-MM-dd}"),
new KeyValuePair<string, string>("raw", $"# [${rtcfg.ReleaseInfo.ReleaseName}](https://github.com/duplicati/duplicati/releases/tag/v${rtcfg.ReleaseInfo.ReleaseName})\n\n{rtcfg.ChangelogNews}")
new KeyValuePair<string, string>("title", $"Release: {rtcfg.ReleaseInfo.Version} ({rtcfg.ReleaseInfo.Channel}) {rtcfg.ReleaseInfo.Timestamp:yyyy-MM-dd}"),
new KeyValuePair<string, string>("raw", $"# [{rtcfg.ReleaseInfo.ReleaseName}](https://github.com/duplicati/duplicati/releases/tag/v{rtcfg.ReleaseInfo.ReleaseName})\n\n{rtcfg.ChangelogNews}")
]);
await client.SendAsync(req);
var resp = await client.SendAsync(req);
resp.EnsureSuccessStatusCode();
}
}
}
+5 -14
View File
@@ -96,24 +96,15 @@ public static partial class Command
/// </summary>
public string ReleaseName => $"{Version}_{Channel.ToString().ToLowerInvariant()}_{Timestamp:yyy-MM-dd}";
/// <summary>
/// Create a new release info
/// </summary>
/// <param name="type">The release type</param>
/// <param name="incVersion">The incremental version</param>
/// <returns>The release info</returns>
public static ReleaseInfo Create(ReleaseChannel type, int incVersion)
=> new ReleaseInfo(new Version(2, 0, 0, incVersion), type, DateTime.Today);
/// <summary>
/// Create a new release info
/// </summary>
/// <param name="type">The release type</param>
/// <param name="version">The version</param>
/// <param name="increment">The build version increment</param>
/// <returns>The release info</returns>
public static ReleaseInfo Create(ReleaseChannel type, Version version)
=> new ReleaseInfo(version, type, DateTime.Today);
public static ReleaseInfo Create(ReleaseChannel type, Version version, int increment)
=> new ReleaseInfo(new Version(version.Major, version.Minor, version.Build, version.Revision + increment), type, DateTime.Today);
}
/// <summary>
@@ -415,8 +406,8 @@ public static partial class Command
var changelogNews = File.ReadAllText(input.ChangelogFile.FullName);
var releaseInfo = string.IsNullOrWhiteSpace(input.Version)
? ReleaseInfo.Create(input.Channel, int.Parse(File.ReadAllText(versionFilePath)) + 1)
: ReleaseInfo.Create(input.Channel, Version.Parse(input.Version));
? ReleaseInfo.Create(input.Channel, Version.Parse(File.ReadAllText(versionFilePath)), 1)
: ReleaseInfo.Create(input.Channel, Version.Parse(input.Version), 0);
Console.WriteLine($"Building {releaseInfo.ReleaseName} ...");
var keyfilePassword = input.Password;
+1 -1
View File
@@ -1 +1 @@
103
2.0.9.99