RJ Trujillo c5a69faba7
feat(ci): Introduce a stable tag (#710)
* feat(ci): Introduce a stable tag

The "stable" and "latest" tags are equivalent. Given "testing" and "unstable"
tags are used, users may likewise figure that the current stable release uses
the "stable" tag

* chore(image-info): Use stable tag

This will rebase to stable on freshly installed images

* chore(os-branch-select): Support stable tag

* chore(readme): Use :stable instead of :latest

---------

Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
2024-01-24 18:45:34 -08:00

61 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/bash
set -e
if [[ $# -eq 1 ]]; then
case "$1" in
"-c")
if [[ -f /var/ublue-update/branch ]]; then
branch=$(cat /var/ublue-update/branch)
else
branch=$(cut -d ":" -f4 <<< "$(rpm-ostree status | grep -m 1 'bazzite')")
fi
case "$branch" in
"latest" | "stable")
echo rel
exit 0
;;
"testing")
echo rc
exit 0
;;
"unstable")
echo main
exit 0
;;
*)
# This can happen on CI builds or when downgrading from a newer build that knows of more branches. The update
# path should decide how to handle it.
echo >&2 "Warning: Unrecognized currently selected branch name '$branch', updates may not succeed."
echo "$branch"
exit 0
;;
esac
;;
"-l")
echo rel
echo rc
echo beta
echo bc
echo main
exit 0
;;
"rel" | "latest" | "stable")
/usr/bin/pkexec /usr/libexec/ublue-update-rebase "stable"
exit 0
;;
"rc" | "beta" | "testing")
/usr/bin/pkexec /usr/libexec/ublue-update-rebase "testing"
exit 0
;;
"bc" | "main" | "unstable")
echo "The unstable branch has a high risk of breaking."
echo "Do NOT use it unless you know what you are doing."
/usr/bin/pkexec /usr/libexec/ublue-update-rebase "unstable"
exit 0
;;
esac
fi
echo "Usage: steamos-select-branch <latest|stable|testing|unstable>" 1>&2