From 9127a2bbc2f9e68afb72bd64e7ce455037ecc059 Mon Sep 17 00:00:00 2001 From: Naveenraj M Date: Sun, 29 Mar 2020 21:29:31 +0530 Subject: [PATCH] specifying spec file --- lib/main.js | 6 ++++-- src/main.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/main.js b/lib/main.js index 92b2048..37c01c7 100644 --- a/lib/main.js +++ b/lib/main.js @@ -30,6 +30,7 @@ function run() { yield io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/'); // Get tar.gz file of release yield download_tar(owner, repo, ref).then(function (filePath) { + console.log(`Tar Path for copy : ${filePath}`); io.cp(filePath, '/root/rpmbuild/SOURCES'); }).catch(function (error) { console.log(error); @@ -42,18 +43,19 @@ function run() { //await io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); // Execute rpmbuild try { - yield exec.exec(`rpmbuild -ba ${specFile}`); + yield exec.exec(`rpmbuild -ba /github/workspace/cello.spec`); } catch (err) { core.setFailed(`action failed with error: ${err}`); } // Get path for rpm //const rpmPath = await exec.exec('node', ['index.js', 'foo=bar'], options); + yield exec.exec('ls /root/rpmbuild/RPMS'); // setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like // actions/upload-release-asset // If you want to upload yourself , need to write api call to upload as asset //core.setOutput("rpmPath", rpmPath) - //core.setOutput("sourceRpmPath", sourceRpmPath) // make option to upload source rpm + core.setOutput("source_rpm_path", "/root/rpmbuild/SRPMS"); // make option to upload source rpm } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index 9378d56..c21638a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -31,6 +31,7 @@ async function run() { repo, ref ).then( function(filePath){ + console.log(`Tar Path for copy : ${filePath}`); io.cp(filePath, '/root/rpmbuild/SOURCES'); }).catch(function(error){ console.log(error); @@ -48,7 +49,7 @@ async function run() { // Execute rpmbuild try { await exec.exec( - `rpmbuild -ba ${specFile}` + `rpmbuild -ba /github/workspace/cello.spec` ); } catch (err) { core.setFailed(`action failed with error: ${err}`); @@ -56,12 +57,13 @@ async function run() { // Get path for rpm //const rpmPath = await exec.exec('node', ['index.js', 'foo=bar'], options); + await exec.exec('ls /root/rpmbuild/RPMS'); // setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like // actions/upload-release-asset // If you want to upload yourself , need to write api call to upload as asset //core.setOutput("rpmPath", rpmPath) - //core.setOutput("sourceRpmPath", sourceRpmPath) // make option to upload source rpm + core.setOutput("source_rpm_path", "/root/rpmbuild/SRPMS") // make option to upload source rpm } catch (error) { core.setFailed(error.message);