mirror of
https://github.com/naveenrajm7/rpmbuild.git
synced 2025-07-12 20:23:50 +00:00
version is a must for source
This commit is contained in:
@ -21,6 +21,7 @@ function run() {
|
|||||||
const owner = context.repo.owner;
|
const owner = context.repo.owner;
|
||||||
const repo = context.repo.repo;
|
const repo = context.repo.repo;
|
||||||
const ref = context.ref;
|
const ref = context.ref;
|
||||||
|
const version = "1.0.0";
|
||||||
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
||||||
const specFile = core.getInput('specFile');
|
const specFile = core.getInput('specFile');
|
||||||
console.log(`Hello ${specFile} from inside a container`);
|
console.log(`Hello ${specFile} from inside a container`);
|
||||||
@ -29,12 +30,12 @@ function run() {
|
|||||||
// Copy spec file from path specFile to /root/rpmbuild/SPECS/
|
// Copy spec file from path specFile to /root/rpmbuild/SPECS/
|
||||||
yield io.cp(`/github/workspace/${specFile}`, '/github/home/rpmbuild/SPECS/');
|
yield io.cp(`/github/workspace/${specFile}`, '/github/home/rpmbuild/SPECS/');
|
||||||
yield exec.exec(`curl -L --output tmp.tar.gz https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`);
|
yield exec.exec(`curl -L --output tmp.tar.gz https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`);
|
||||||
yield exec.exec(`mkdir ${repo}`);
|
yield exec.exec(`mkdir ${repo}-${version}`);
|
||||||
yield exec.exec(`tar xvf tmp.tar.gz -C ${repo} --strip-components 1`);
|
yield exec.exec(`tar xvf tmp.tar.gz -C ${repo}-${version} --strip-components 1`);
|
||||||
yield exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`);
|
yield exec.exec(`tar -czvf ${repo}-${version}.tar.gz ${repo}-${version}`);
|
||||||
// Get repo files from /github/workspace/
|
// Get repo files from /github/workspace/
|
||||||
yield exec.exec('ls -la ');
|
yield exec.exec('ls -la ');
|
||||||
yield exec.exec(`cp ${repo}.tar.gz /github/home/rpmbuild/SOURCES/`);
|
yield exec.exec(`cp ${repo}-${version}.tar.gz /github/home/rpmbuild/SOURCES/`);
|
||||||
// Copy tar.gz file to /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
|
// make sure the name of tar.gz is same as given in Source of spec file
|
||||||
//await io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
|
//await io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
|
||||||
|
10
src/main.ts
10
src/main.ts
@ -14,6 +14,8 @@ async function run() {
|
|||||||
const repo = context.repo.repo
|
const repo = context.repo.repo
|
||||||
const ref = context.ref
|
const ref = context.ref
|
||||||
|
|
||||||
|
const version = "1.0.0"
|
||||||
|
|
||||||
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
||||||
|
|
||||||
const specFile = core.getInput('specFile');
|
const specFile = core.getInput('specFile');
|
||||||
@ -27,15 +29,15 @@ async function run() {
|
|||||||
|
|
||||||
await exec.exec(`curl -L --output tmp.tar.gz https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`)
|
await exec.exec(`curl -L --output tmp.tar.gz https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`)
|
||||||
|
|
||||||
await exec.exec(`mkdir ${repo}`);
|
await exec.exec(`mkdir ${repo}-${version}`);
|
||||||
|
|
||||||
await exec.exec(`tar xvf tmp.tar.gz -C ${repo} --strip-components 1`);
|
await exec.exec(`tar xvf tmp.tar.gz -C ${repo}-${version} --strip-components 1`);
|
||||||
|
|
||||||
await exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`);
|
await exec.exec(`tar -czvf ${repo}-${version}.tar.gz ${repo}-${version}`);
|
||||||
|
|
||||||
// Get repo files from /github/workspace/
|
// Get repo files from /github/workspace/
|
||||||
await exec.exec('ls -la ');
|
await exec.exec('ls -la ');
|
||||||
await exec.exec(`cp ${repo}.tar.gz /github/home/rpmbuild/SOURCES/`);
|
await exec.exec(`cp ${repo}-${version}.tar.gz /github/home/rpmbuild/SOURCES/`);
|
||||||
|
|
||||||
// Copy tar.gz file to /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
|
// make sure the name of tar.gz is same as given in Source of spec file
|
||||||
|
Reference in New Issue
Block a user