Skip to main content

upload_release_asset

Function upload_release_asset 

Source
pub fn upload_release_asset(
    token: &str,
    repo: &Repo,
    tag: &str,
    tarball: &Path,
) -> Result<String>
Expand description

Attach tarball to the release for tag.

Returns the download URL, or already <name> when GitHub refuses the upload because the release already has a complete asset of that name. The run that got there first, or an earlier attempt of this one, uploaded it.

ยงErrors

Returns an error when:

  • tarball has no UTF-8 file name or cannot be read.
  • The GitHub client cannot be built.
  • The release for tag does not exist.
  • The asset of that name exists but its upload does not complete within a minute.
  • The upload fails for a reason other than a duplicate asset.