GitHub Actions 构建 RPM

问题描述

目前我正在尝试如何使用 GitHub Actions 构建 RPM。 但我总是收到此错误消息:The process '/usr/bin/cp' Failed with exit code 1

这是我的操作的链接https://github.com/Robs-Organisation/RobsCalculatorProject/actions/runs/509396649

我不太确定问题出在哪里。

我的 RPM .spec 文件如下所示:

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}/

我的工作流文件如下所示:

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/rpmbuild@v1.0.0
        with:
          # path to the spec file
          spec_file: /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/rpmbuild/specFile/calculator.spec
        
      - name: check for new builds
        run: ls

如果有人有时间看一看,我将不胜感激!

解决方法

失败的命令是:

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

重复的 '/github/workspace//github/workspace` 看起来很可疑。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...