Fixes #12 Artifacts will now be replaced

This commit is contained in:
Nick Cipollo
2020-03-02 17:52:44 -05:00
parent 767a5edcf4
commit d57d57cad2
15 changed files with 265 additions and 45 deletions

View File

@@ -18,10 +18,12 @@ class Action {
}
perform() {
return __awaiter(this, void 0, void 0, function* () {
const uploadUrl = yield this.createOrUpdateRelease();
const releaseResponse = yield this.createOrUpdateRelease();
const releaseId = releaseResponse.id;
const uploadUrl = releaseResponse.upload_url;
const artifacts = this.inputs.artifacts;
if (artifacts.length > 0) {
yield this.uploader.uploadArtifacts(artifacts, uploadUrl);
yield this.uploader.uploadArtifacts(artifacts, releaseId, uploadUrl);
}
});
}
@@ -49,7 +51,7 @@ class Action {
updateRelease(id) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.releases.update(id, this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name, this.inputs.prerelease);
return response.data.upload_url;
return response.data;
});
}
noPublishedRelease(error) {
@@ -80,7 +82,7 @@ class Action {
createRelease() {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.releases.create(this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name, this.inputs.prerelease);
return response.data.upload_url;
return response.data;
});
}
}