Skip to content

Commit e93c7db

Browse files
authored
Merge pull request #4590 from devlead/feature/gh-4589
GH4589: Upload GitHub Artifacts
2 parents 5f6cfc1 + 87ac3a6 commit e93c7db

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

build.cake

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ Task("Upload-AppVeyor-Artifacts")
207207
}
208208
});
209209

210+
Task("Upload-GitHubActions-Artifacts")
211+
.IsDependentOn("Package")
212+
.WithCriteria(BuildSystem.IsRunningOnGitHubActions, nameof(BuildSystem.IsRunningOnGitHubActions))
213+
.Does<BuildParameters>(
214+
static (context, parameters) => context
215+
.GitHubActions() is var gh && gh != null
216+
? gh.Commands
217+
.UploadArtifact(parameters.Paths.Directories.NuGetRoot, $"Artifact_{gh.Environment.Runner.ImageOS ?? gh.Environment.Runner.OS}_{context.Environment.Runtime.BuiltFramework.Identifier}_{context.Environment.Runtime.BuiltFramework.Version}")
218+
: throw new Exception("GitHubActions not available")
219+
);
220+
210221
Task("Publish-AzureDevOps")
211222
.IsDependentOn("Sign-Binaries")
212223
.IsDependentOn("Package")
@@ -252,9 +263,8 @@ Task("Publish-AzureDevOps")
252263
})
253264
.OnError<BuildParameters>((exception, parameters) =>
254265
{
266+
// Azure Artifacts not critical
255267
Information("Publish-AzureDevOps Task failed, but continuing with next Task...");
256-
// Temp fix already published to Azure Artifacts
257-
// parameters.PublishingError = true;
258268
});
259269

260270
Task("Publish-NuGet")
@@ -444,10 +454,12 @@ Task("AppVeyor")
444454

445455

446456
Task("GitHubActions")
457+
.IsDependentOn("Upload-GitHubActions-Artifacts")
447458
.IsDependentOn("Run-Integration-Tests")
448459
.IsDependentOn("Publish-AzureDevOps");
449460

450461
Task("GitHubActions-Release")
462+
.IsDependentOn("Upload-GitHubActions-Artifacts")
451463
.IsDependentOn("Publish-AzureDevOps")
452464
.IsDependentOn("Publish-NuGet")
453465
.IsDependentOn("Publish-GitHub-Release")

0 commit comments

Comments
 (0)