-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
64 lines (58 loc) · 1.67 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build source rpm
description: Build source rpm
inputs:
tarball:
description: Tarball with the sources
required: true
specfile:
description: RPM spec file
required: true
sourcefiles:
description: Additional source files
required: false
outputs:
path:
description: Path to the created source rpm
value: ${{ steps.result.outputs.path }}
file:
description: File name to the created source rpm
value: ${{ steps.result.outputs.file }}
runs:
using: 'composite'
steps:
- name: Prepare rpm directory structure
id: buildroot
shell: bash
run: |
dir=`mktemp -d`
mkdir -p $dir/rpmbuild/BUILD
mkdir -p $dir/rpmbuild/RPMS
mkdir -p $dir/rpmbuild/SOURCES
mkdir -p $dir/rpmbuild/SPECS
mkdir -p $dir/rpmbuild/SRPMS
echo "path=$dir/rpmbuild" >> $GITHUB_OUTPUT
- name: Move tarball to rpm buildroot
shell: bash
run: |
cp ${{ inputs.tarball }} ${{ steps.buildroot.outputs.path }}/SOURCES/
- name: Copy source files to rpm buildroot
env:
files: ${{ inputs.sourcefiles }}
shell: bash
run: |
for file in $files; do
cp $file ${{ steps.buildroot.outputs.path }}/SOURCES/
done
- name: Build source rpm
id: build
shell: bash
run: |
rpmbuild --define "_topdir ${{ steps.buildroot.outputs.path }}" -bs ${{ inputs.specfile }}
- name: Set output srpm path
id: result
shell: bash
run: |
path=`ls ${{ steps.buildroot.outputs.path }}/SRPMS/*.rpm`
file=`basename $path`
echo "path=$path" >> $GITHUB_OUTPUT
echo "file=$file" >> $GITHUB_OUTPUT