Interface Publishing
- All Known Implementing Classes:
GitHub
public interface Publishing
Creates GitHub releases and uploads assets to them.
-
Method Summary
Modifier and TypeMethodDescriptionensureRelease(String owner, String repo, String tag, String name) Creates a release fortag, or returns the existing release if one already exists for that tag.voiduploadAsset(Release release, File file, String assetName) Uploads a file as an asset attached torelease.
-
Method Details
-
ensureRelease
Creates a release fortag, or returns the existing release if one already exists for that tag.- Parameters:
owner- the GitHub account or organization that owns the repository.repo- the repository name, without the owner prefix.tag- the git tag for the release (GitHub auto-creates a lightweight tag if absent).name- the human-readable release title; if null, defaults totag.- Returns:
- the created or pre-existing release, including its asset upload URL.
- Throws:
RuntimeException- if authentication fails or the GitHub API returns an error.RateLimitException- if the GitHub API rate limit has been exceeded.
-
uploadAsset
Uploads a file as an asset attached torelease.- Parameters:
release- the release to attach the asset to, as returned byensureRelease(java.lang.String, java.lang.String, java.lang.String, java.lang.String).file- the file to upload.assetName- the asset name as it will appear in the release.- Throws:
IOException- if the upload request fails.
-