【问题标题】:GitHub Actions building RPMGitHub Actions 构建 RPM
【发布时间】:2021-04-29 07:22:53
【问题描述】:

目前我正在尝试如何使用 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

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

【问题讨论】:

  • 这只是一个常规的复制命令失败;可以分享一下日志吗?
  • @AaronD.Marasco [@octokit/rest] const Octokit = require("@octokit/rest") 已弃用。使用const { Octokit } = require("@octokit/rest") 代替名称:计算器版本:1.0 /usr/bin/rpmdev-setuptree /usr/bin/cp /github/workspace//github/workspace/rpmbuild/specFile/calculator.spec /github/home/rpmbuild/SPECS / /usr/bin/cp: cannot stat '/github/workspace//github/workspace/rpmbuild/specFile/calculator.spec': No such file or directory Error: The process '/usr/bin/cp' failed with exit代码 1
  • GitHub 说“登录以查看日志”,因此它们以某种方式受到保护。我认为@msuchy 在他的回答中有所作为。

标签: rpm github-actions rpmbuild rpm-spec


【解决方案1】:

在失败的命令是:

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

重复的“/ github上/工作区// github上/ workspace`似乎腥。 P>

【讨论】: