my current problem is, that i want to include my CalcBuffaloBinary-File into my RPM Package. I thing i have something wrong into the %prep or/and %files section.
The error:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.xGBE0b
+ umask 022
+ cd /github/home/rpmbuild/BUILD
+ mkdir -p /github/home/rpmbuild/BUILDROOT/calculator-1.0-1.el7.x86_64//usr/bin
+ cp /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/CalcBuffaloBinary /github/home/rpmbuild/BUILDROOT/calculator-1.0-1.el7.x86_64//usr/bin/calculator
cp: cannot stat '/home/runner/work/RobsCalculatorProject/RobsCalculatorProject/CalcBuffaloBinary': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.xGBE0b (%prep)
Bad exit status from /var/tmp/rpm-tmp.xGBE0b (%prep)
My .spec file looks like this:
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: calculator-1.0.tar.gz
Requires: postgresql
%description
This is a description
%setup -c
%prep
mkdir -p %{buildroot}/%{_bindir}
cp /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/CalcBuffaloBinary %{buildroot}/%{_bindir}/%{name}
%build
%install
%files
/home/runner/work/RobsCalculatorProject/RobsCalculatorProject/CalcBuffaloBinary
My CalcBuffaloBinary-File is located at:
/home/runner/work/RobsCalculatorProject/RobsCalculatorProject/CalcBuffaloBinary
Check for files with ls -l:
Run ls -l
total 26968
-rw-r--r-- 1 runner docker 27600036 Jan 29 11:33 CalcBuffaloBinary
-rw-r--r-- 1 runner docker 35 Jan 29 11:33 README.md
-rw-r--r-- 1 runner docker 627 Jan 29 11:33 calculator.spec
drwxr-xr-x 7 runner docker 4096 Jan 29 11:33 rpmbuild
My workflow .yml:
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_with_buffalo:
name: build binary with Buffalo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'
- name: get Buffalo Framwork
run: cd rpmbuild/sourceCode; go get -u github.com/gobuffalo/buffalo/buffalo
- name: Set up npm
run: pip install npm
- name: remove node_module and install it again
run: cd rpmbuild/sourceCode;rm -rf node_modules; npm install
- name: check if npm works
run: npm -v
- name: build with buffalo
run: cd rpmbuild/sourceCode;buffalo build -vo CalcBuffaloBinary
- name: move binary for upload
run: cd rpmbuild/sourceCode;mv CalcBuffaloBinary /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/
- name: Upload Buffalo Binary
uses: actions/upload-artifact@v2
with:
name: CalcBuffaloBinary
path: /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/CalcBuffaloBinary
build_rpm:
name: build RPM
needs: build_with_buffalo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download calcBinary
uses: actions/download-artifact@v2
with:
name: CalcBuffaloBinary
path: /home/runner/work/RobsCalculatorProject/RobsCalculatorProject/
- name: ls -l
run: ls -l
- 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: calculator.spec
- name: Upload calc RPM
uses: actions/upload-artifact@v2
with:
name: calcSRPM
path: rpmbuild/SRPMS/calculator-1.0-1.el7.src.rpm
I would be pleased if anybody can help!
question from:https://stackoverflow.com/questions/65953000/build-rpm-in-github-actions-spec-file-produces-error