Interface IGitHubReleaseHelper
- Namespace
- Invex.Atom.Module.GitHubWorkflows.Helpers
- Assembly
- Invex.Atom.Module.GitHubWorkflows.dll
Provides helper methods for interacting with GitHub Releases within Invex.Atom builds.
public interface IGitHubReleaseHelper : IGitHubHelper, IBuildAccessor
- Inherited Members
Remarks
This interface extends IGitHubHelper to provide functionality for uploading artifacts to a GitHub Release, leveraging the GitHub API.
Methods
UploadArtifactToRelease(string, string, bool, CancellationToken)
Uploads a build artifact to a specified GitHub Release.
Task UploadArtifactToRelease(string artifactName, string releaseTag, bool dryRunWhenNotRunningInGitHubActions = true, CancellationToken cancellationToken = default)
Parameters
artifactNamestringThe name of the artifact to upload. This name should correspond to a directory within the Atom artifacts directory.
releaseTagstringThe tag of the GitHub Release to which the artifact should be uploaded (e.g., "v1.0.0").
dryRunWhenNotRunningInGitHubActionsboolIf
true(default), the upload operation will be simulated (logged but not executed) when the build is not running in a GitHub Actions environment.cancellationTokenCancellationTokenA cancellation token to observe while waiting for the task to complete.
Returns
- Task
A System.Threading.Tasks.Task representing the asynchronous operation.
Remarks
The artifact will be zipped before uploading if it's a directory.
Exceptions
- InvalidOperationException
Thrown if no release exists with the given tag.
UploadAssetToRelease(string, RootedPath, bool, CancellationToken)
Uploads a generic asset (file or directory) to a specified GitHub Release.
Task UploadAssetToRelease(string releaseTag, RootedPath assetPath, bool dryRunWhenNotRunningInGitHubActions = true, CancellationToken cancellationToken = default)
Parameters
releaseTagstringThe tag of the GitHub Release to which the asset should be uploaded (e.g., "v1.0.0").
assetPathRootedPathThe path to the asset (file or directory) to upload.
dryRunWhenNotRunningInGitHubActionsboolIf
true(default), the upload operation will be simulated (logged but not executed) when the build is not running in a GitHub Actions environment.cancellationTokenCancellationTokenA cancellation token to observe while waiting for the task to complete.
Returns
- Task
A System.Threading.Tasks.Task representing the asynchronous operation.
Remarks
If assetPath points to a directory, it will be zipped into a .zip file
with the same name before uploading. If it points to a file that is not a .zip file,
a .zip file containing only that file is uploaded.
Exceptions
- InvalidOperationException
Thrown if no release exists with the given tag.