Skip to content

Commit

Permalink
add stable.txt
Browse files Browse the repository at this point in the history
[ cherry-picked from cilium/cilium repository ]

Add `stable.txt`, a file in the master branch that always points to the
latest stable release of Cilium. This file can be used as a reference by
tools such as the Cilium CLI to get the latest stable release version.
This pattern and file is already applied to the Hubble CLI repository.

Ultimately, this new file will allow the Cilium CLI to always install
the latest version of Cilium, as initially planned[0], instead of the
version hardcoded in the CLI binary.

[0]: cilium/cilium-cli#121 (comment)

Co-authored-by: Joe Stringer <[email protected]>
Signed-off-by: Robin Hahling <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
Signed-off-by: Quentin Monnet <[email protected]>
  • Loading branch information
rolinh and joestringer committed Jun 7, 2024
1 parent 0e47cda commit a0b4de2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions internal/bump-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ PROJECTS_REGEX='s/.*projects\/\([0-9]\+\).*/\1/'
ACTS_YAML=".github/cilium-actions.yml"
REMOTE="$(get_remote)"

latest_stable=""
for release in $(grep "General Announcement" README.rst \
| sed 's/.*tree\/\(v'"$MAJ_REGEX"'\).*/\1/'); do
latest=$(git describe --tags $REMOTE/$release \
| sed 's/v//' | sed 's/\('"$MIN_REGEX"'\).*/\1/')
if [ -z "$latest_stable" ]; then
# the first release in the list is the latest stable
latest_stable=$latest
echo "v$latest_stable" > stable.txt
fi
if grep -q -F $latest README.rst; then
continue
fi
Expand All @@ -39,5 +45,10 @@ for release in $(grep "General Announcement" README.rst \
sed -i 's/\(projects\/\)'$old_proj'/\1'$new_proj'/g' $ACTS_YAML
done

git add README.rst $ACTS_YAML
git commit -s -m "Update stable releases"
git add README.rst stable.txt $ACTS_YAML
if ! git diff-index --quiet HEAD -- README.rst stable.txt $ACTS_YAML; then
git commit -s -m "Update stable releases"
echo "README.rst and stable.txt updated, submit the PR now."
else
echo "No new releases found."
fi

0 comments on commit a0b4de2

Please sign in to comment.