mirror of
https://github.com/naveenrajm7/rpmbuild.git
synced 2025-07-11 20:04:42 +00:00
Remove lib/download-release-archive.js
* Introduced in281f2b8
* Replaced with `curl` inab399dd
* Typescript removed in2c036ef
* Import removed in2ff761f
* Compiled js finally removed in whatever sha this is Tracking down the history of this file was kind of fun because I could see how @naveenrajm7's thinking evolved for getting the repo source into the rpmbuild SOURCES directory.
This commit is contained in:
@ -1,45 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
const { Octokit } = require('@octokit/rest');
|
||||
//const fs = require('fs');
|
||||
const tc = require('@actions/tool-cache');
|
||||
function download_archive(owner, repo, ref) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const octokit = new Octokit();
|
||||
const archive_format = "tarball";
|
||||
const tag = "v1.0.0";
|
||||
const tarFile = `${repo}-1.0.tar.gz`;
|
||||
console.log("Calling API ...");
|
||||
yield octokit.repos.getArchiveLink({
|
||||
owner,
|
||||
repo,
|
||||
archive_format,
|
||||
ref
|
||||
}).then(({ data }) => {
|
||||
fs.writeFile(tarFile, Buffer.from(data), function (err) {
|
||||
if (err) {
|
||||
return console.log(err);
|
||||
}
|
||||
console.log("The Tar file was saved!");
|
||||
console.log(`Tarball Location : ${tarFile}`);
|
||||
return tarFile;
|
||||
});
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
module.exports = download_archive;
|
Reference in New Issue
Block a user