Magento 1 was here:
http://connect20.magentocommerce.com/community/Mage_All_Latest/releases.xml
Where is Magento 2?
Since the latest Magento 2 code is published to GitHub (unlike Magento 1), the list of all releases can be found there: https://github.com/magento/magento2/releases
great, if we rely on github releases, then we can create some simple check/variable from:
VERSION=$(curl -s https://api.github.com/repos/magento/magento2/releases 2>&1 | head -36 | grep -E 'tag_name|published_at')
echo "${VERSION}"
"tag_name": "2.0.1",
"published_at": "2016-01-20T14:59:42Z",
UPDATE: correct way to get the latest version number (cause of magento versioning):
VERSION=$(curl -s https://api.github.com/repos/magento/magento2/tags 2>&1 | head -3 | grep -oP '(?<=")\d.*(?=")')
You can get releases at https://github.com/mageplaza/magento-versions
Souce: https://raw.githubusercontent.com/mageplaza/magento-versions/master/releases/releases.json
{
"2.2.3": {
"v": "2.2.3",
"s": "stable",
"d": "2018-02-27"
},
"2.2.2": {
"v": "2.2.2",
"s": "stable",
"d": "2017-12-12"
},
"2.2.1": {
"v": "2.2.1",
"s": "stable",
"d": "2017-11-07"
}
}
Source: https://raw.githubusercontent.com/mageplaza/magento-versions/master/releases/releases.xml
<?xml version="1.0" encoding="UTF-8"?>
<releases>
<r>
<v>2.2.3</v>
<s>stable</s>
<d>2018-02-27</d>
</r>
<r>
<v>2.2.2</v>
<s>stable</s>
<d>2017-12-12</d>
</r>
</releases>
I prefer this bash command
VERSION_FULL=$(curl --silent "https://api.github.com/repos/magento/magento2/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
echo $VERSION_FULL