chore: Cleanup version information to be more intuitive (#1737)

* chore(build): remove suffix from upstream tag

Currently, the image carries the upstream tag with its suffix. However,
we add our own suffix on top, to communicate changes. This only appears
in the image repo. Therefore, remove the extra one to reduce user confusion.

* chore(os-release): use version-pretty instead of sha to be more intuitive

* chore(build): include git SHA in testing builds, harmonize unstable
This commit is contained in:
Antheas Kapenekakis 2024-10-14 18:30:40 +02:00 committed by GitHub
parent 394b179e51
commit 13ca8b403a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -197,6 +197,9 @@ jobs:
# Generate the primary version key that will be stored on os-release,
# shown on the bootloader, and used for the image tag.
UPSTREAM_TAG="${{ env.SOURCE_IMAGE_VERSION }}"
# Remove .0 suffix from upstream tag so we can add our own and
# the wrong one does not end up in the image.
UPSTREAM_TAG="${UPSTREAM_TAG%.*}"
FEDORA_VERSION="${{ matrix.fedora_version }}"
SHA_SHORT="${GITHUB_SHA::7}"
@ -204,11 +207,11 @@ jobs:
VERSION="pr-${FEDORA_VERSION}-${{ github.event.pull_request.number }}"
PRETTY_VERSION="PR (${{ github.event.pull_request.number }}, ${UPSTREAM_TAG})"
elif [[ ${{ github.ref_name }} == "unstable" ]]; then
VERSION="unstable-${SHA_SHORT}"
PRETTY_VERSION="Unstable (#${SHA_SHORT}, F${UPSTREAM_TAG})"
VERSION="unstable-${UPSTREAM_TAG}"
PRETTY_VERSION="Unstable (F${UPSTREAM_TAG}, #${SHA_SHORT})"
elif [[ ${{ github.ref_name }} == "testing" ]]; then
VERSION="testing-${UPSTREAM_TAG}"
PRETTY_VERSION="Testing (F${UPSTREAM_TAG})"
PRETTY_VERSION="Testing (F${UPSTREAM_TAG}, #${SHA_SHORT})"
else
VERSION="${UPSTREAM_TAG}"
PRETTY_VERSION="Stable (F${UPSTREAM_TAG})"

View File

@ -61,9 +61,7 @@ sed -i "s/^ANSI_COLOR=.*/ANSI_COLOR=\"$LOGO_COLOR\"/" /usr/lib/os-release
sed -i "/^REDHAT_BUGZILLA_PRODUCT=/d; /^REDHAT_BUGZILLA_PRODUCT_VERSION=/d; /^REDHAT_SUPPORT_PRODUCT=/d; /^REDHAT_SUPPORT_PRODUCT_VERSION=/d" /usr/lib/os-release
sed -i "s|^VERSION_CODENAME=.*|VERSION_CODENAME=\"$CODE_NAME\"|" /usr/lib/os-release
if [[ -n "${SHA_HEAD_SHORT:-}" ]]; then
echo "BUILD_ID=\"$SHA_HEAD_SHORT (Built $(date +%m-%d-%Y))\"" >> /usr/lib/os-release
fi
echo "BUILD_ID=\"$VERSION_PRETTY\"" >> /usr/lib/os-release
# FIXME: Pretty name needs to have deck/KDE/GNOME/etc
echo "BOOTLOADER_NAME=\"$IMAGE_PRETTY_NAME $VERSION_PRETTY\"" >> /usr/lib/os-release