Skip to content

Commit

Permalink
fix invalidop on no RELEASES file
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Nov 4, 2024
1 parent 3620d24 commit 33eb21c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Distribution/VelopackBuildDistributor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ await Program.RunCommand("vpk", $"[{_operatingSystemName}] pack"

if (Program.CanUseGitHub)
{
Log.Information("Uploading release {version}-{channel} to GitHub", version, _channel);
Log.Information("Uploading release {version:l}-{channel:l} to GitHub", version, _channel);

await Program.RunCommand("vpk", $"upload github"
+ $" --repoUrl=\"{Program.GitHubRepoUrl}\""
Expand Down
14 changes: 11 additions & 3 deletions Distribution/WindowsVelopackBuildDistributor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using Octokit;
using Serilog;

namespace DragonFruit.OnionFruit.Deploy.Distribution;

Expand Down Expand Up @@ -30,10 +31,17 @@ public override async Task PublishBuild(string version)

var targetRelease = releases.Single(x => x.TagName.Equals(version));
var installerAsset = targetRelease.Assets.Single(x => x.Name.Equals($"{Program.VelopackId}-{channel}-Setup.exe"));
var releasesAsset = targetRelease.Assets.Single(x => x.Name.Equals("RELEASES"));


Log.Information("Renaming installer file...");
await Program.GitHubClient.Repository.Release.EditAsset(Program.GitHubRepoUser, Program.GitHubRepoName, installerAsset.Id, new ReleaseAssetUpdate($"install-{installerSuffix}.exe"));
await Program.GitHubClient.Repository.Release.EditAsset(Program.GitHubRepoUser, Program.GitHubRepoName, releasesAsset.Id, new ReleaseAssetUpdate("ONIONFRUITUPGRADE"));

if (channel == "win")
{
Log.Information("Renaming RELEASES file...");

var releasesAsset = targetRelease.Assets.Single(x => x.Name.Equals("RELEASES"));
await Program.GitHubClient.Repository.Release.EditAsset(Program.GitHubRepoUser, Program.GitHubRepoName, releasesAsset.Id, new ReleaseAssetUpdate("ONIONFRUITUPGRADE"));
}
}
}
}

0 comments on commit 33eb21c

Please sign in to comment.