Allows the user to specify additional repositories to enable before building the rpm
Signed-off-by: Cyrille Bollu <cyrille@debian-BULLSEYE-live-builder-AMD64>
Resolves https://github.com/naveenrajm7/rpmbuild/issues/7
Previously,
```js
await exec.exec(
`rpmbuild -ba /github/home/rpmbuild/SPECS/${specFile}`
);
```
would fail when given this input:
```yml
- name: build RPM package
id: my-rpm
uses: naveenrajm7/rpmbuild
with:
spec_file: "rpm/my-specfile.spec"
```
The failure arises because previously, the code said:
```js
const specFile = core.getInput('spec_file');
await exec.exec(`cp /github/workspace/${specFile} /github/home/rpmbuild/SPECS/`);
```
Which meant the commands which ended up being run in the rpmbuild-container
were equivalent to:
```sh
$ cp /github/workspace/rpm/my-specfile.spec /github/home/rpmbuild/SPECS/
$ rpmbuild -ba /home/github/home/rpmbuild/SPECS/rpm/my-specfile.spec
```
`rpmbuild -ba` fails in this situation because the `cp` does not copy the specfile
into `/github/home/rpmbuild/SPECS/rpm/my-specfile.spec`, but instead
into `/github/home/rpmbuild/SPECS/my-specfile.spec`.
The solution is to use the basename of the specfile for `rpmbuild -ba`.
As a matter of personal preference, I've changed the shell commands to
always operate on source-file and destination-file, rather than on
source-file and destination-paths. I've just generally found my own scripts
easier to maintain when I'm a little more explicit like this.
Resolves https://github.com/naveenrajm7/rpmbuild/issues/2
We don't need `lib/main.js` any more, so I've removed it.
Some previou devDependencies from `package.json` are now
production dependencies.
* Introduced in 281f2b8
* Replaced with `curl` in ab399dd
* Typescript removed in 2c036ef
* Import removed in 2ff761f
* Compiled js finally removed in whatever sha this is
Tracking down the history of this file was kind of fun because I could
see how @naveenrajm7's thinking evolved for getting the repo source
into the rpmbuild SOURCES directory.
Previously, in order to create /github/home/rpmbuild/SOURCES/foo-1.2.0.tar.gz,
rpmbuild did the following:
1. use curl to download a tarball of the project source
2. unpack it into a local directory
3. repack it with the correct desired directory structure
4. move the repacked tarball to /github/home/rpmbuild/SOURCES
This failed for me at step 1 because the repo I'm trying to use rpmbuild on
is a private repo. There's no means of plumbing a github auth token into the
`curl` command, so the tarball fails to download and everything else fails.
----
Since we have the current repo tree in /github/workspace, we can coerce `git`
to make the archive for us. Now, we:
1. ask git to make the archive
and everything works with a private repo. In order to make this approach work,
I've added `git` into the build container.