Skip to content

Commit b21b7fb

Browse files
committed
CI (github-hosted): add support for 10-kitten
1 parent 27c7d23 commit b21b7fb

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

.github/workflows/build-rpi-github-hosted.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ on:
3434
default: '9'
3535
type: choice
3636
options:
37+
- 10k
3738
- 9
3839
- 8
3940

@@ -72,6 +73,9 @@ jobs:
7273
# 8 has no GPT image
7374
- version_major: '8'
7475
partitioning: 'gpt'
76+
# 10-kitten has no MBR image
77+
- version_major: '10k'
78+
partitioning: 'mbr'
7579

7680
steps:
7781
- uses: actions/checkout@v4
@@ -83,9 +87,26 @@ jobs:
8387
8488
- name: Prepare AlmaLinux Minor version number
8589
run: |
86-
release=$(rpm -q --qf="%{VERSION}\n" https://repo.almalinux.org/almalinux/almalinux-release-latest-${{ inputs.version_major }}.aarch64.rpm 2>/dev/null)
90+
version_major=${{ inputs.version_major }}
91+
version_major=${version_major%k}
92+
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"
97+
;;
98+
*)
99+
release_url="https://repo.almalinux.org/almalinux/almalinux-release-latest-${version_major}.aarch64.rpm"
100+
container_version="${version_major}"
101+
;;
102+
esac
103+
release=$(rpm -q --qf="%{VERSION}\n" ${release_url} 2>/dev/null)
87104
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
88108
[ "x${version_minor}" != "x" ] && echo "version_minor=${version_minor}" >> $GITHUB_ENV
109+
[ "x${container_version}" != "x" ] && echo "container_version=${container_version}" >> $GITHUB_ENV
89110
90111
- name: Prepare some environment stuff
91112
run: |
@@ -97,7 +118,7 @@ jobs:
97118
9)
98119
python3_imgcreate=/usr/lib/python3.9/site-packages/imgcreate/
99120
;;
100-
10)
121+
10|10k)
101122
python3_imgcreate=/usr/lib/python3.12/site-packages/imgcreate/
102123
;;
103124
*)
@@ -131,8 +152,8 @@ jobs:
131152
echo "rpi_image_resultdir=${rpi_image_resultdir}" >> $GITHUB_ENV
132153
133154
# Image file base name
134-
image_name="AlmaLinux-${{ inputs.version_major }}-RaspberryPi-${{ matrix.partitioning }}-${{ inputs.version_major }}.${{ env.version_minor }}-${date_stamp}.aarch64"
135-
[ "${{ matrix.image_types }}" = "gnome" ] && image_name="AlmaLinux-${{ inputs.version_major }}-RaspberryPi-GNOME-${{ matrix.partitioning }}-${{ inputs.version_major }}.${{ env.version_minor }}-${date_stamp}.aarch64"
155+
image_name="AlmaLinux-${{ inputs.version_major }}-RaspberryPi-${{ matrix.partitioning }}-${{ env.full_release_version }}-${date_stamp}.aarch64"
156+
[ "${{ matrix.image_types }}" = "gnome" ] && image_name="AlmaLinux-${{ inputs.version_major }}-RaspberryPi-GNOME-${{ matrix.partitioning }}-${{ env.full_release_version }}-${date_stamp}.aarch64"
136157
echo "image_name=${image_name}" >> $GITHUB_ENV
137158
138159
- name: Install KVM and libvirt packages
@@ -193,7 +214,7 @@ jobs:
193214
194215
# Docerfile to build image for RPi creation
195216
cat << 'EOF' > Dockerfile
196-
FROM almalinux:${{ inputs.version_major }}
217+
FROM almalinux:${{ env.container_version }}
197218
198219
# Set the working directory in the container
199220
WORKDIR /
@@ -442,7 +463,7 @@ jobs:
442463
MATTERMOST_CHANNEL: ${{ vars.MATTERMOST_CHANNEL }}
443464
MATTERMOST_USERNAME: ${{ github.triggering_actor }}
444465
TEXT: |
445-
**AlmaLinux OS ${{ inputs.version_major }}.${{ env.version_minor }} Raspberry Pi image Build** `${{ env.date_time_stamp }}` generated by the GitHub [Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
466+
**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 }})
446467
447468
:almalinux: **${{ matrix.image_types }} ${{ matrix.partitioning }}**
448469
@@ -458,7 +479,7 @@ jobs:
458479
MATTERMOST_CHANNEL: ${{ vars.MATTERMOST_CHANNEL }}
459480
MATTERMOST_USERNAME: ${{ github.triggering_actor }}
460481
TEXT: |
461-
**AlmaLinux OS ${{ inputs.version_major }}.${{ env.version_minor }} Raspberry Pi image Build** `${{ env.date_time_stamp }}` generated by the GitHub [Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
482+
**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 }})
462483
463484
:almalinux: **${{ matrix.image_types }} ${{ matrix.partitioning }}**
464485

0 commit comments

Comments
 (0)