copy rpm to workspace

This commit is contained in:
Naveenraj M
2020-03-30 14:02:20 +05:30
parent 19d8f15bf1
commit 44a969a0b7
2 changed files with 20 additions and 4 deletions

View File

@ -63,11 +63,17 @@ function run() {
else { else {
// the *entire* stdout and stderr (buffered) // the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`); console.log(`stdout: ${stdout}`);
myOutput = `${stdout}`; myOutput = myOutput + `${stdout}`;
console.log(`stderr: ${stderr}`); console.log(`stderr: ${stderr}`);
} }
}); });
core.setOutput("source_rpm_path", `/github/home/rpmbuild/SRPMS/${myOutput}`); // make option to upload source rpm // only contents of workspace can be changed by actions and used by subsequent actions
// So copy all generated rpms into workspace , and publish output path relative to workspace
yield exec.exec(`mkdir -p rpmbuild/SRPMS`);
yield exec.exec(`cp /github/home/rpmbuild/SRPMS/${myOutput} rpmbuild/SRPMS`);
yield exec.exec(`ls -la rpmbuild/SRPMS`);
// set output to path relative to workspace ex ./rpm/
core.setOutput("source_rpm_path", `rpmbuild/SRPMS`); // make option to upload source rpm
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);

View File

@ -70,12 +70,22 @@ async function run() {
} else { } else {
// the *entire* stdout and stderr (buffered) // the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`); console.log(`stdout: ${stdout}`);
myOutput = `${stdout}`; myOutput = myOutput+`${stdout}`;
console.log(`stderr: ${stderr}`); console.log(`stderr: ${stderr}`);
} }
}); });
core.setOutput("source_rpm_path", `/github/home/rpmbuild/SRPMS/${myOutput}`); // make option to upload source rpm
// only contents of workspace can be changed by actions and used by subsequent actions
// So copy all generated rpms into workspace , and publish output path relative to workspace
await exec.exec(`mkdir -p rpmbuild/SRPMS`)
await exec.exec(`cp /github/home/rpmbuild/SRPMS/${myOutput} rpmbuild/SRPMS`)
await exec.exec(`ls -la rpmbuild/SRPMS`)
// set output to path relative to workspace ex ./rpm/
core.setOutput("source_rpm_path", `rpmbuild/SRPMS`); // make option to upload source rpm
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);