mirror of
https://github.com/naveenrajm7/rpmbuild.git
synced 2025-07-12 04:13:50 +00:00
setup ts file with steps
This commit is contained in:
26
src/main.ts
26
src/main.ts
@ -1,11 +1,37 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const github = require('@actions/github');
|
const github = require('@actions/github');
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const myInput = core.getInput('specFile');
|
const myInput = core.getInput('specFile');
|
||||||
core.debug(`Hello ${myInput} from inside a container`);
|
core.debug(`Hello ${myInput} from inside a container`);
|
||||||
|
|
||||||
|
// Get repo files from /github/workspace/
|
||||||
|
await exec.exec('ls -la /github/workspace');
|
||||||
|
|
||||||
|
// LOG: know current directory
|
||||||
|
await exec.exec('pwd && echo $HOME && ls');
|
||||||
|
|
||||||
|
// Copy spec file from path specFile to /root/rpmbuild/SPECS/
|
||||||
|
|
||||||
|
|
||||||
|
// Get tar.gz file of release
|
||||||
|
|
||||||
|
|
||||||
|
// Copy tar.gz file to /root/rpmbuild/SOURCES
|
||||||
|
|
||||||
|
|
||||||
|
// Execute rpmbuild
|
||||||
|
|
||||||
|
|
||||||
|
// Get path for rpm
|
||||||
|
|
||||||
|
|
||||||
|
// setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like
|
||||||
|
// actions/upload-release-asset
|
||||||
|
|
||||||
|
|
||||||
// Get github context data
|
// Get github context data
|
||||||
const context = github.context;
|
const context = github.context;
|
||||||
console.log(`We can even get context data, like the repo: ${context.repo.repo}`);
|
console.log(`We can even get context data, like the repo: ${context.repo.repo}`);
|
||||||
|
Reference in New Issue
Block a user