diff --git a/lib/main.js b/lib/main.js index 8d81ead..10b5dc5 100644 --- a/lib/main.js +++ b/lib/main.js @@ -31,19 +31,20 @@ function run() { // Get tar.gz file of release yield download_tar(owner, repo, ref).then(function (filePath) { console.log(`Tar Path for copy : ${filePath}`); - io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/'); + io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/'); }).catch(function (error) { console.log(error); }); //console.log(`Tar Path for copy : ${tarBallPath}`); // Get repo files from /github/workspace/ yield exec.exec('ls -la '); + yield io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/'); // Copy tar.gz file to /root/rpmbuild/SOURCES // make sure the name of tar.gz is same as given in Source of spec file //await io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); // Execute rpmbuild try { - yield exec.exec(`rpmbuild -ba /github/workspace/cello.spec`); + yield exec.exec(`rpmbuild --define '_topdir /root/rpmbuild' -ba /github/workspace/cello.spec`); } catch (err) { core.setFailed(`action failed with error: ${err}`); diff --git a/src/main.ts b/src/main.ts index 998dfec..3d29492 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,7 +32,7 @@ async function run() { ref ).then( function(filePath){ console.log(`Tar Path for copy : ${filePath}`); - io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/'); + io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/'); }).catch(function(error){ console.log(error); }); @@ -41,6 +41,7 @@ async function run() { // Get repo files from /github/workspace/ await exec.exec('ls -la '); + await io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/'); // Copy tar.gz file to /root/rpmbuild/SOURCES // make sure the name of tar.gz is same as given in Source of spec file @@ -49,7 +50,7 @@ async function run() { // Execute rpmbuild try { await exec.exec( - `rpmbuild -ba /github/workspace/cello.spec` + `rpmbuild --define '_topdir /root/rpmbuild' -ba /github/workspace/cello.spec` ); } catch (err) { core.setFailed(`action failed with error: ${err}`);