3434        default : ' 9' 
3535        type : choice 
3636        options :
37-           - 10k 
37+           - 10-kitten 
3838          - 9 
3939          - 8 
4040
41+       iteration :
42+         description : ' Kitten 10 build iteration' 
43+         required : true 
44+         default : ' 0' 
45+ 
4146      store_as_artifact :
4247        description : " Store images to the workflow Artifacts" 
4348        required : true 
7479          - version_major : ' 8' 
7580            partitioning : ' gpt' 
7681          #  10-kitten has no MBR image
77-           - version_major : ' 10k ' 
82+           - version_major : ' 10-kitten ' 
7883            partitioning : ' mbr' 
7984
8085    steps :
@@ -85,43 +90,48 @@ jobs:
8590        sudo apt-get -y update 
8691        sudo apt-get -y install xz-utils unzip rpm 
8792
88-      - name : Prepare AlmaLinux Minor version number 
93+      - name : Set environment variables 
8994      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+ 
92102        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}" 
97109            ;; 
98110          *) 
99111            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}" 
101115            ;; 
102116        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+ 
109121        # Use AlmaLinux 9 to build 10 images since appliance-tools not available in 10 yet 
110122        container_version=${version_major} 
111123        [ "x${container_version}" = "x10" ] && container_version=9 
112124        echo "container_version=${container_version}" >> $GITHUB_ENV 
113125
114-      - name : Prepare some environment stuff 
115-       run : | 
116126        # Path to the python3-imgcreate fs.py 
117-         case ${{ env. container_version } } in 
127+         case ${container_version} in 
118128          8) 
119129            python3_imgcreate=/usr/lib/python3.6/site-packages/imgcreate/ 
120130            ;; 
121131          9) 
122132            python3_imgcreate=/usr/lib/python3.9/site-packages/imgcreate/ 
123133            ;; 
124-           10|10k ) 
134+           10* ) 
125135            python3_imgcreate=/usr/lib/python3.12/site-packages/imgcreate/ 
126136            ;; 
127137          *) 
@@ -147,23 +157,16 @@ jobs:
147157        echo "need_pkgs=${need_pkgs}" >> $GITHUB_ENV 
148158
149159        # 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" 
151161        echo "kickstart=${kickstart}" >> $GITHUB_ENV 
152162
153163        # Appliance Tools results directory 
154164        rpi_image_resultdir="/rpi-image" 
155165        echo "rpi_image_resultdir=${rpi_image_resultdir}" >> $GITHUB_ENV 
156166
157167        # 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" 
167170        echo "image_name=${image_name}" >> $GITHUB_ENV 
168171
169172     - name : Install KVM and libvirt packages 
@@ -267,7 +270,7 @@ jobs:
267270        appliance-creator \ 
268271        -c ${{ env.kickstart }} \ 
269272        -d -v --logfile ${{ env.rpi_image_resultdir }}/${{ env.image_name }}.log \ 
270-         --cache ./cache8  --no-compress \ 
273+         --cache ./cache  --no-compress \ 
271274        -o ${{ env.rpi_image_resultdir }} --format raw --name ${{ env.image_name }} | \ 
272275        tee ${{ env.rpi_image_resultdir }}/${{ env.image_name }}.log.2 
273276
@@ -489,7 +492,7 @@ jobs:
489492        MATTERMOST_CHANNEL : ${{ vars.MATTERMOST_CHANNEL }} 
490493        MATTERMOST_USERNAME : ${{ github.triggering_actor }} 
491494        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 }}) 
493496
494497          :almalinux: **${{ matrix.image_types }} ${{ matrix.partitioning }}** 
495498
0 commit comments