-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.47 KB
/
build-rpm.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
# Build RPM
name: Build RPM Package
on:
push:
tags:
- 'release-rpm-*'
- 'release-[0-9]+*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set RPM Version and Release
run: |
TAG_REF=${GITHUB_REF#refs/tags/}
VERSION=$(echo $TAG_REF | sed -E 's/^[a-zA-Z\-]+-//g')
echo "RPM_VERSION=$VERSION" >> $GITHUB_ENV
echo "RPM_RELEASE=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV
- name: Prepare Source
run: |
TAR_VERSION="${{ env.RPM_VERSION }}-${{ env.RPM_RELEASE }}"
TAR_NAME="bash-tui-${TAR_VERSION}.tar.gz"
mkdir -p $HOME/rpmbuild/SOURCES
tar czf $HOME/rpmbuild/SOURCES/$TAR_NAME --exclude=.git .
- name: Just test home
run: echo $HOME
- name: Build RPM
run: |
TAR_VERSION="${{ env.RPM_VERSION }}-${{ env.RPM_RELEASE }}"
rpmbuild -ba bash-tui.spec \
--define "_sourcedir $HOME/rpmbuild/SOURCES" \
--define "tar_version $TAR_VERSION" \
--define "rpm_version ${{ env.RPM_VERSION }}" \
--define "rpm_release ${{ env.RPM_RELEASE }}" \
--define "_srcrpmdir $HOME" \
--define "_rpmdir $HOME"
- name: Upload RPM Artifacts
uses: actions/upload-artifact@v4
with:
name: bash-tui
path: |
/home/runner/bash-tui-*.src.rpm
/home/runner/x86_64/bash-tui-*.rpm
if-no-files-found: warn