Automate latest docker version determining for re-tagging #3905
Description
In #3842 the file .github/workflows/docker-release-tags.yml
is added which is responsible of re-tagging docker releases.
In that file LATEST_RELEASE
environment variable is hardcoded to 0.6
right now, but any time a new Major or Minor version is release, we must manually update that environment variable in all files of all branches available.
This opens gates to new bugs because it's easy to forget to update this variable in some of the branches where this file exists.
Instead, we should improve the flow to automatically determine the current latest
version and re-tag latest
tag if the newly uploaded docker release version is higher than the one which is currently tagged by latest
tag.
For example, the automation flow could look something like this:
- Fetch
janusgraph/janusgraph:latest
manifest. - Find revision number of the fetches image.
- Fetch all tags of the determined revision number.
- Find the tag which matches the semantic versioning regex pattern (I.e. major.minor.patch).
- Compare the version of the newly uploaded docker images to the version of the image which is tagged by
latest
tag. - If the new version is higher than the old version - re-tag
latest
tag to the new docker image.
This way we can removeLATEST_RELEASE
from the file and automatically determine current latest version instead.