diff --git a/BuildTools/LicenseUpdater/LicenseUpdater.csproj b/BuildTools/LicenseUpdater/LicenseUpdater.csproj index a44450dc4..551de1203 100755 --- a/BuildTools/LicenseUpdater/LicenseUpdater.csproj +++ b/BuildTools/LicenseUpdater/LicenseUpdater.csproj @@ -1,11 +1,11 @@ - - - - Exe - net8.0 - license_upgrader - enable - enable - - - + + + + Exe + net8.0 + license_upgrader + enable + enable + + + diff --git a/ReleaseBuilder/.vscode/launch.json b/ReleaseBuilder/.vscode/launch.json index a5c3bf397..eda9ce2ac 100644 --- a/ReleaseBuilder/.vscode/launch.json +++ b/ReleaseBuilder/.vscode/launch.json @@ -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", diff --git a/ReleaseBuilder/Build/Command.Upload.cs b/ReleaseBuilder/Build/Command.Upload.cs index 406385dbf..b6fdef146 100644 --- a/ReleaseBuilder/Build/Command.Upload.cs +++ b/ReleaseBuilder/Build/Command.Upload.cs @@ -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("category", "10"), - new KeyValuePair("title", $"Release: ${rtcfg.ReleaseInfo.Version} (${rtcfg.ReleaseInfo.Channel}) ${rtcfg.ReleaseInfo.Timestamp:yyyy-MM-dd}"), - new KeyValuePair("raw", $"# [${rtcfg.ReleaseInfo.ReleaseName}](https://github.com/duplicati/duplicati/releases/tag/v${rtcfg.ReleaseInfo.ReleaseName})\n\n{rtcfg.ChangelogNews}") + new KeyValuePair("title", $"Release: {rtcfg.ReleaseInfo.Version} ({rtcfg.ReleaseInfo.Channel}) {rtcfg.ReleaseInfo.Timestamp:yyyy-MM-dd}"), + new KeyValuePair("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(); } } } diff --git a/ReleaseBuilder/Build/Command.cs b/ReleaseBuilder/Build/Command.cs index 98e997361..ccba9e9e9 100644 --- a/ReleaseBuilder/Build/Command.cs +++ b/ReleaseBuilder/Build/Command.cs @@ -96,24 +96,15 @@ public static partial class Command /// public string ReleaseName => $"{Version}_{Channel.ToString().ToLowerInvariant()}_{Timestamp:yyy-MM-dd}"; - - /// - /// Create a new release info - /// - /// The release type - /// The incremental version - /// The release info - public static ReleaseInfo Create(ReleaseChannel type, int incVersion) - => new ReleaseInfo(new Version(2, 0, 0, incVersion), type, DateTime.Today); - /// /// Create a new release info /// /// The release type /// The version + /// The build version increment /// The release info - 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); } /// @@ -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; diff --git a/ReleaseBuilder/build_version.txt b/ReleaseBuilder/build_version.txt index a9c8fe829..2f89b7ed2 100644 --- a/ReleaseBuilder/build_version.txt +++ b/ReleaseBuilder/build_version.txt @@ -1 +1 @@ -103 +2.0.9.99