Skip to content

Commit 7c0e7c6

Browse files
actions: update RPM build workflow
Build a tarball using python-build, then use that to build the SRPM Use dnf instead of yum throughout
1 parent b5f80a2 commit 7c0e7c6

File tree

1 file changed

+50
-26
lines changed

1 file changed

+50
-26
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,45 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
jobs:
23+
tarball:
24+
name: Tarball
25+
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Get source code
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.x'
36+
37+
- name: Install build requirements
38+
run: python -m pip install build
39+
40+
- name: Create distributions
41+
run: python -m build . --sdist --wheel --outdir .
42+
43+
- uses: actions/upload-artifact@v4
44+
with:
45+
name: tarball
46+
path: htgettoken-*.tar.*
47+
if-no-files-found: error
48+
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: wheel
52+
path: htgettoken*.whl
53+
if-no-files-found: error
54+
2355
# -- RPM builds --
2456

2557
# Build the Source RPM
2658
rhel-srpm:
2759
name: EL ${{ matrix.version }} (${{ matrix.distro }}) source package
60+
needs:
61+
- tarball
2862
strategy:
2963
fail-fast: false
3064
matrix:
@@ -36,29 +70,23 @@ jobs:
3670
version: 9
3771
runs-on: ubuntu-latest
3872
container: ${{ matrix.distro }}:${{ matrix.version }}
73+
env:
74+
TARBALL: "htgettoken-*.tar.*"
3975
steps:
40-
- name: Get source code
41-
uses: actions/checkout@v3
76+
- name: Download tarball
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: tarball
4280

4381
- name: Configure SRPM build tools
4482
run: |
45-
yum -y install \
46-
make \
47-
python-srpm-macros \
83+
dnf -y install \
84+
"*-srpm-macros" \
4885
rpm-build \
49-
yum-utils \
5086
;
5187
52-
- name: Create distributions
53-
run: make sources
54-
5588
- name: Create source package
56-
run: |
57-
rpmbuild \
58-
--define "_sourcedir $(pwd)" \
59-
--define "_srcrpmdir $(pwd)" \
60-
-bs \
61-
htgettoken.spec
89+
run: rpmbuild -ts --define "_srcrpmdir $(pwd)" ${TARBALL}
6290

6391
- uses: actions/upload-artifact@v4
6492
with:
@@ -96,24 +124,20 @@ jobs:
96124
dnf config-manager --set-enabled crb
97125
98126
- name: Configure EPEL
99-
run: yum -y install epel-release
127+
run: dnf -y install epel-release
100128

101129
- name: Install build tools
102130
run: |
103-
yum -y -q install \
131+
dnf -y -q install \
104132
rpm-build \
105-
yum-utils \
133+
"dnf-command(builddep)" \
106134
;
107135
108-
- name: Install epel-rpm-macros
109-
if: matrix.version < 9
110-
run: yum -y -q install epel-rpm-macros
111-
112136
- name: Install build dependencies
113-
run: yum-builddep -y htgettoken-*.src.rpm
137+
run: dnf builddep -y htgettoken-*.src.rpm
114138

115139
- name: List installed packages
116-
run: yum list installed
140+
run: dnf list installed
117141

118142
- name: Build binary packages
119143
run: |
@@ -164,10 +188,10 @@ jobs:
164188
name: rpm-${{ matrix.distro }}-${{ matrix.version }}
165189

166190
- name: Configure EPEL
167-
run: yum -y install epel-release
191+
run: dnf -y install epel-release
168192

169193
- name: Install RPMs
170-
run: yum -y install *.rpm
194+
run: dnf -y install *.rpm
171195

172196
- name: Test htgettoken
173197
run: /usr/bin/htgettoken --help

0 commit comments

Comments
 (0)