-
Notifications
You must be signed in to change notification settings - Fork 6
197 lines (169 loc) · 5.06 KB
/
Copy pathbuild.yml
File metadata and controls
197 lines (169 loc) · 5.06 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Build and test
on:
# run workflows on main master and release/** branches
push:
branches:
- main
- master
- release/**
# run workflows on pull requests against the same branches
pull_request:
branches:
- main
- master
- release/**
# automatically cancel redundant builds
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tarball:
name: Tarball
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install build requirements
run: python -m pip install build
- name: Create distributions
run: python -m build . --sdist --wheel --outdir .
- uses: actions/upload-artifact@v4
with:
name: tarball
path: htgettoken-*.tar.*
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: wheel
path: htgettoken*.whl
if-no-files-found: error
# -- RPM builds --
# Build the Source RPM
rhel-srpm:
name: EL ${{ matrix.version }} (${{ matrix.distro }}) source package
needs:
- tarball
strategy:
fail-fast: false
matrix:
# Build for Rockylinux >=8
include:
- distro: rockylinux
version: 8
- distro: rockylinux
version: 9
runs-on: ubuntu-latest
container: ${{ matrix.distro }}:${{ matrix.version }}
env:
TARBALL: "htgettoken-*.tar.*"
steps:
- name: Download tarball
uses: actions/download-artifact@v4
with:
name: tarball
- name: Configure SRPM build tools
run: |
dnf -y install \
"*-srpm-macros" \
rpm-build \
;
- name: Create source package
run: rpmbuild -ts --define "_srcrpmdir $(pwd)" ${TARBALL}
- uses: actions/upload-artifact@v4
with:
name: srpm-${{ matrix.distro }}-${{ matrix.version }}
path: "*.src.rpm"
if-no-files-found: error
# Build the binary RPM(s)
rhel-rpm:
name: EL ${{ matrix.version }} (${{ matrix.distro }}) binary package(s)
needs:
- rhel-srpm
strategy:
fail-fast: false
matrix:
# Build for Rockylinux >=8
include:
- distro: rockylinux
version: 8
- distro: rockylinux
version: 9
runs-on: ubuntu-latest
container: ${{ matrix.distro }}:${{ matrix.version }}
steps:
- name: Download SRPM
uses: actions/download-artifact@v4
with:
name: srpm-${{ matrix.distro }}-${{ matrix.version }}
# on RL9 python3-wheel is provided via 'CRB'
- name: Enable CRB (Rocky Linux >=9)
if: matrix.version >= 9
run: |
dnf -y -q install "dnf-command(config-manager)"
dnf config-manager --set-enabled crb
- name: Configure EPEL
run: dnf -y install epel-release
- name: Install build tools
run: |
dnf -y -q install \
rpm-build \
"dnf-command(builddep)" \
;
- name: Install build dependencies
run: dnf builddep -y htgettoken-*.src.rpm
- name: List installed packages
run: dnf list installed
- name: Build binary packages
run: |
rpmbuild --rebuild --define "_rpmdir $(pwd)" htgettoken-*.src.rpm
rm -f *.src.rpm
mv */*.rpm .
- name: Print package info
run: |
# print contents of packages
for rpmf in *.rpm; do
echo "===== ${rpmf} ======="
rpm --query --package "${rpmf}" --info
echo "----- Files: --------"
rpm --query --package "${rpmf}" --list
echo "----- Provides: -----"
rpm --query --package "${rpmf}" --provides
echo "----- Requires: -----"
rpm --query --package "${rpmf}" --requires
done
- uses: actions/upload-artifact@v4
with:
name: rpm-${{ matrix.distro }}-${{ matrix.version }}
path: "*.rpm"
if-no-files-found: error
# Install the binary RPM(s) and sanity check
rhel-install:
name: EL ${{ matrix.version }} (${{ matrix.distro }}) install test
needs:
- rhel-rpm
strategy:
fail-fast: false
matrix:
# Build for Rockylinux >=8
include:
- distro: rockylinux
version: 8
- distro: rockylinux
version: 9
runs-on: ubuntu-latest
container: ${{ matrix.distro }}:${{ matrix.version }}
steps:
- name: Download RPMs
uses: actions/download-artifact@v4
with:
name: rpm-${{ matrix.distro }}-${{ matrix.version }}
- name: Configure EPEL
run: dnf -y install epel-release
- name: Install RPMs
run: dnf -y install *.rpm
- name: Test htgettoken
run: /usr/bin/htgettoken --help