Search code examples
rpmgithub-actionsrpmbuildrpm-spec

GitHub Actions building RPM


Currently i am trying out, how to build an RPM with GitHub Actions. But i always get this error message: The process '/usr/bin/cp' failed with exit code 1

Here is a link to my action: https://github.com/Robs-Organisation/RobsCalculatorProject/actions/runs/509396649

I am not quite sure, where the problem is.

My .spec File for the RPM looks like that:

Name:           calculator
Version:        1.0
Release:        1%{?dist}
Summary:        a calculator to learn something about gobuffalo

License:        All rights reserved
URL:            https://github.com/Robs-Organisation/RobsCalculatorProject
Source0:        /rpmbuild/tarball/%{name}-%{version}.tar.gz

Requires:       postgresql

%description
This is a description

%prep
%setup -q

%build
make

%install
make install

%files
%{_bindir}/%{name}/

My workflow file looks like that:

jobs:
  build_tarball:
    name: Builds .tar file
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - name: build .tar.gz
        run: tar -czvf calculator-1.0.tar.gz /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/rpmbuild/sourceCode/
        
      - name: Upload calculator-1.0.tar.gz 
        uses: actions/upload-artifact@v2
        with:
          name: calTarball
          path: calculator-1.0.tar.gz
          
  temp_job:
    name: build RPM
    needs: build_tarball
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        
      - name: Download calculator-1.0.tar.gz
        uses: actions/download-artifact@v2
        with:
          name: calTarball
  
      - name: move file to /rpmbuild/tarball/
        run: mv calculator-1.0.tar.gz /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/rpmbuild/tarball/

      - name: check if move was successful
        run: ls /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/rpmbuild/tarball/
        
      - name: check for testfile
        run: ls /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/rpmbuild/specFile/  
        
      - name: check for path
        run: pwd
        
      - name: RPM Build
        # You may pin to the exact commit or the version.
        # uses: naveenrajm7/rpmbuild@b52f0e593effaa08f4726afa0d0e2960131685c7
        id: rpm
        uses: naveenrajm7/[email protected]
        with:
          # path to the spec file
          spec_file: /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/rpmbuild/specFile/calculator.spec
        
      - name: check for new builds
        run: ls

If someone has some time to take a look, i would appreciate it!


Solution

  • The command in failure is:

     /usr/bin/cp /github/workspace//github/workspace/rpmbuild/specFile/calculator.spec /github/home/rpmbuild/SPECS/
    

    The duplicate '/github/workspace//github/workspace` seems fishy.