34
34
default : ' 9'
35
35
type : choice
36
36
options :
37
- - 10k
37
+ - 10-kitten
38
38
- 9
39
39
- 8
40
40
41
+ iteration :
42
+ description : ' Kitten 10 build iteration'
43
+ required : true
44
+ default : ' 0'
45
+
41
46
store_as_artifact :
42
47
description : " Store images to the workflow Artifacts"
43
48
required : true
74
79
- version_major : ' 8'
75
80
partitioning : ' gpt'
76
81
# 10-kitten has no MBR image
77
- - version_major : ' 10k '
82
+ - version_major : ' 10-kitten '
78
83
partitioning : ' mbr'
79
84
80
85
steps :
@@ -85,43 +90,48 @@ jobs:
85
90
sudo apt-get -y update
86
91
sudo apt-get -y install xz-utils unzip rpm
87
92
88
- - name : Prepare AlmaLinux Minor version number
93
+ - name : Set environment variables
89
94
run : |
90
- version_major=${{ inputs.version_major }}
91
- version_major=${version_major%k}
95
+ # Set environment variables
96
+ version_major=${{ matrix.version_major }}
97
+ version_minor=
98
+ code_name_var=${{ matrix.version_major }}
99
+ kickstart_var=${{ matrix.version_major }}
100
+ iteration=
101
+
92
102
case ${{ inputs.version_major }} in
93
- *k) ## Kitten
94
- release_url="https://repo.almalinux.org/almalinux-kitten/almalinux-kitten-release-latest-${version_major}.aarch64.rpm"
95
- container_version="${version_major}-kitten"
96
- kitten="Kitten"
103
+ 10-kitten)
104
+ version_major=10
105
+ code_name_var="Kitten"
106
+ kickstart_var="${code_name_var}-${version_major}"
107
+ iteration=.${{ inputs.iteration }}
108
+ release_str="${code_name_var} ${version_major}"
97
109
;;
98
110
*)
99
111
release_url="https://repo.almalinux.org/almalinux/almalinux-release-latest-${version_major}.aarch64.rpm"
100
- container_version="${version_major}"
112
+ release=$(rpm -q --qf="%{VERSION}\n" ${release_url} 2>/dev/null)
113
+ version_minor=.$(cut -d '.' -f 2 <<< "$release")
114
+ release_str="${version_major}${version_minor}"
101
115
;;
102
116
esac
103
- release=$(rpm -q --qf="%{VERSION}\n" ${release_url} 2>/dev/null)
104
- version_minor=$(cut -d '.' -f 2 <<< "$release")
105
- [ "x${kitten}" != "x" ] && echo "kitten=${kitten} " >> $GITHUB_ENV
106
- [ "x${release}" != "x" ] && echo "full_release_version=${release}" >> $GITHUB_ENV
107
- [ "x${version_major}" != "x" ] && echo "version_major=${version_major}" >> $GITHUB_ENV
108
- [ "x${version_minor}" != "x" ] && echo "version_minor=${version_minor}" >> $GITHUB_ENV
117
+
118
+ # Release string, 8.10, 9.5 or Kitten 10
119
+ echo "release_str=${release_str}" >> $GITHUB_ENV
120
+
109
121
# Use AlmaLinux 9 to build 10 images since appliance-tools not available in 10 yet
110
122
container_version=${version_major}
111
123
[ "x${container_version}" = "x10" ] && container_version=9
112
124
echo "container_version=${container_version}" >> $GITHUB_ENV
113
125
114
- - name : Prepare some environment stuff
115
- run : |
116
126
# Path to the python3-imgcreate fs.py
117
- case ${{ env. container_version } } in
127
+ case ${container_version} in
118
128
8)
119
129
python3_imgcreate=/usr/lib/python3.6/site-packages/imgcreate/
120
130
;;
121
131
9)
122
132
python3_imgcreate=/usr/lib/python3.9/site-packages/imgcreate/
123
133
;;
124
- 10|10k )
134
+ 10* )
125
135
python3_imgcreate=/usr/lib/python3.12/site-packages/imgcreate/
126
136
;;
127
137
*)
@@ -147,23 +157,16 @@ jobs:
147
157
echo "need_pkgs=${need_pkgs}" >> $GITHUB_ENV
148
158
149
159
# Kickstart file name
150
- kickstart="AlmaLinux-${{ inputs.version_major } }-RaspberryPi-${{ matrix.image_types }}-${{ matrix.partitioning }}.aarch64.ks"
160
+ kickstart="AlmaLinux-${kickstart_var }-RaspberryPi-${{ matrix.image_types }}-${{ matrix.partitioning }}.aarch64.ks"
151
161
echo "kickstart=${kickstart}" >> $GITHUB_ENV
152
162
153
163
# Appliance Tools results directory
154
164
rpi_image_resultdir="/rpi-image"
155
165
echo "rpi_image_resultdir=${rpi_image_resultdir}" >> $GITHUB_ENV
156
166
157
167
# Image file base name
158
- if [ "x${{ env.kitten }}" = "x" ]; then
159
- image_name="AlmaLinux-${{ env.version_major }}-RaspberryPi-${{ matrix.partitioning }}-${{ env.full_release_version }}-${date_stamp}.aarch64"
160
- [ "${{ matrix.image_types }}" = "gnome" ] && image_name="AlmaLinux-${{ env.version_major }}-RaspberryPi-GNOME-${{ matrix.partitioning }}-${{ env.full_release_version }}-${date_stamp}.aarch64"
161
- else
162
- # Kitten
163
- image_name="AlmaLinux-Kitten-RaspberryPi-${{ matrix.partitioning }}-${{ env.version_major }}-${date_stamp}.aarch64"
164
- # Kitten GNOME
165
- [ "${{ matrix.image_types }}" = "gnome" ] && image_name="AlmaLinux-Kitten-RaspberryPi-GNOME-${{ matrix.partitioning }}-${{ env.version_major }}-${date_stamp}.aarch64"
166
- fi
168
+ image_name="AlmaLinux-${code_name_var}-RaspberryPi-${{ matrix.partitioning }}-${version_major}${version_minor}-${date_stamp}${iteration}.aarch64"
169
+ [ "${{ matrix.image_types }}" = "gnome" ] && image_name="AlmaLinux-${code_name_var}-RaspberryPi-GNOME-${{ matrix.partitioning }}-${version_major}${version_minor}-${date_stamp}${iteration}.aarch64"
167
170
echo "image_name=${image_name}" >> $GITHUB_ENV
168
171
169
172
- name : Install KVM and libvirt packages
@@ -267,7 +270,7 @@ jobs:
267
270
appliance-creator \
268
271
-c ${{ env.kickstart }} \
269
272
-d -v --logfile ${{ env.rpi_image_resultdir }}/${{ env.image_name }}.log \
270
- --cache ./cache8 --no-compress \
273
+ --cache ./cache --no-compress \
271
274
-o ${{ env.rpi_image_resultdir }} --format raw --name ${{ env.image_name }} | \
272
275
tee ${{ env.rpi_image_resultdir }}/${{ env.image_name }}.log.2
273
276
@@ -489,7 +492,7 @@ jobs:
489
492
MATTERMOST_CHANNEL : ${{ vars.MATTERMOST_CHANNEL }}
490
493
MATTERMOST_USERNAME : ${{ github.triggering_actor }}
491
494
TEXT : |
492
- **AlmaLinux OS ${{ env.kitten }}${{ env.full_release_version }} Raspberry Pi image Build** `${{ env.date_time_stamp }}` generated by the GitHub [Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
495
+ **AlmaLinux OS ${{ env.release_str }} Raspberry Pi image Build** `${{ env.date_time_stamp }}` generated by the GitHub [Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
493
496
494
497
:almalinux: **${{ matrix.image_types }} ${{ matrix.partitioning }}**
495
498
0 commit comments