naveenrajm7 / rpmbuild

A GitHub Action to build RPMs from source code and spec file, uses rpmbuild .
https://github.com/marketplace/actions/rpm-build
GNU General Public License v3.0
32 stars 48 forks source link

Doesn't work with spec file in non-root directory #7

Closed pboyd04 closed 2 years ago

pboyd04 commented 3 years ago

My repo has it's spec file in /rpm/

It copies correctly: /usr/bin/cp /github/workspace/rpm/libredfish.spec /github/home/rpmbuild/SPECS/

Then it breaks trying to do the build: /usr/bin/rpmbuild -ba /github/home/rpmbuild/SPECS/rpm/libredfish.spec error: failed to stat /github/home/rpmbuild/SPECS/rpm/libredfish.spec: No such file or directory Error: action failed with error: Error: The process '/usr/bin/rpmbuild' failed with exit code 1

belden commented 3 years ago

I forked this repo today and fixed this issue for myself. I'll clean up the code changes and submit a PR tomorrow.

belden commented 3 years ago

Hi @pboyd04,

FYI I've submitted my patch as a pr against this project. You can test it for your own project by updating your workflow file to point at my branch:

- name: build RPM package
  id: my-rpm
  uses: belden/rpmbuild@issue-7-specfile-below-root
  with:
    spec_file: "rpm/my-specfile.spec"

Long term you shouldn't rely on belden/rpmbuild@issue-7-specfile-below-root, but it should work for you today so you can continue experimenting with whatever your project is.

veenstrajelmer commented 2 years ago

My spec file is also not in the root, I have copied it there to test this action, but for the long term it would be nice if it is fixed.