Skip to content

Add support for source files #11

Add support for source files

Add support for source files #11

Workflow file for this run

name: Test
on:
push:
pull_request:
jobs:
action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create mock project tarball
run: |
echo "#!/bin/bash" > test.sh
echo "echo I am here." >> test.sh
echo "testing" > readme.md
echo "testing2" > readme2.md
tar -cvzf action-build-srpm-1.tar.gz --transform "s,^,action-build-srpm-1/," *
- name: Create spec file
shell: bash
run: |
cat <<EOF > test.spec
Name: action-build-srpm
Version: 1
Release: 1%{?dist}
Summary: Test action-build-srpm
URL: https://github.com/next-actions/action-build-srpm
License: GPLv3+
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: readme.md
Source2: readme2.md
%description
Test action-build-srpm.
%prep
%setup -q
%install
mkdir -p %{buildroot}/%{_bindir}
mv test.sh %{buildroot}/%{_bindir}/
chmod a+x %{buildroot}/%{_bindir}/test.sh
%files
%{_bindir}/test.sh
EOF
- name: Build source rpm
id: srpm
uses: ./
with:
tarball: action-build-srpm-1.tar.gz
specfile: test.spec
sourcefiles: |
readme.md
readme2.md
- name: Validate source rpm files
run: |
for file in $(rpm -qlp ${{ steps.srpm.outputs.path }}); do
echo $file | grep -e 'test\.spec' -e 'readme\.md' -e 'readme2\.md' -e 'action-build-srpm-1.tar.gz'
done