Fixes #19 Bump dependencies & update octokit usage

This commit is contained in:
Nick Cipollo
2020-07-20 14:07:43 -04:00
parent 94366fd224
commit 067437b167
12 changed files with 1411 additions and 1248 deletions

View File

@@ -18,18 +18,18 @@ class GithubArtifactUploader {
await this.deleteUpdatedArtifacts(artifacts, releaseId);
}
for (const artifact of artifacts) {
await this.uploadArtifact(artifact, uploadUrl);
await this.uploadArtifact(artifact, releaseId, uploadUrl);
}
}
async uploadArtifact(artifact, uploadUrl, retry = 3) {
async uploadArtifact(artifact, releaseId, uploadUrl, retry = 3) {
try {
core.debug(`Uploading artifact ${artifact.name}...`);
await this.releases.uploadArtifact(uploadUrl, artifact.contentLength, artifact.contentType, artifact.readFile(), artifact.name);
await this.releases.uploadArtifact(uploadUrl, artifact.contentLength, artifact.contentType, artifact.readFile(), artifact.name, releaseId);
}
catch (error) {
if (error.status >= 500 && retry > 0) {
core.warning(`Failed to upload artifact ${artifact.name}. ${error.message}. Retrying...`);
await this.uploadArtifact(artifact, uploadUrl, retry - 1);
await this.uploadArtifact(artifact, releaseId, uploadUrl, retry - 1);
}
else {
core.warning(`Failed to upload artifact ${artifact.name}. ${error.message}.`);