mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
auto create channel
This commit is contained in:
@@ -196,6 +196,8 @@ public class VelopackFlowServiceClient(
|
||||
$"Creating release {version}",
|
||||
async (report) => {
|
||||
report(-1);
|
||||
await CreateChannelIfNotExists(packageId, channel, cancellationToken);
|
||||
report(50);
|
||||
var result = await CreateReleaseGroupAsync(packageId, version, channel, cancellationToken);
|
||||
report(100);
|
||||
return result;
|
||||
@@ -312,6 +314,16 @@ public class VelopackFlowServiceClient(
|
||||
Logger.LogWarning("Release did not go live within 5 minutes (timeout).");
|
||||
}
|
||||
|
||||
private async Task CreateChannelIfNotExists(string packageId, string channel, CancellationToken cancellationToken)
|
||||
{
|
||||
var request = new CreateChannelRequest() {
|
||||
PackageId = packageId,
|
||||
Name = channel,
|
||||
};
|
||||
var client = GetFlowApi();
|
||||
await client.CreateChannelAsync(request, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<ReleaseGroup> CreateReleaseGroupAsync(string packageId, SemanticVersion version, string channel, CancellationToken cancellationToken)
|
||||
{
|
||||
CreateReleaseGroupRequest request = new() {
|
||||
|
||||
Reference in New Issue
Block a user