Fix versions.py to include release stage

Signed-off-by: Joffrey F <f.joffrey@gmail.com>
diff --git a/scripts/versions.py b/scripts/versions.py
old mode 100644
new mode 100755
index 93fe0d7..4bdcb74
--- a/scripts/versions.py
+++ b/scripts/versions.py
@@ -26,8 +26,8 @@
                 edition = stage
                 stage = None
             elif '-' in stage:
-                edition, stage = stage.split('-')
-        major, minor, patch = version.split('.', 3)
+                edition, stage = stage.split('-', 1)
+        major, minor, patch = version.split('.', 2)
         return cls(major, minor, patch, stage, edition)
 
     @property
@@ -63,7 +63,7 @@
         res = requests.get(url)
         content = res.text
         versions = [Version.parse(v) for v in re.findall(
-                r'"docker-([0-9]+\.[0-9]+\.[0-9]+)-?.*tgz"', content
+            r'"docker-([0-9]+\.[0-9]+\.[0-9]+-?.*)\.tgz"', content
         )]
         sorted_versions = sorted(
             versions, reverse=True, key=operator.attrgetter('order')