Explorar el Código

ci: use `-patch.[0-9]+` for patch releases

Using just `-[0-9]+` requires further changes to the parser in `emqx_release`, and might
also cause problems with Elixir's `Version.parse` depending on the suffix.
Thales Macedo Garitezi hace 2 años
padre
commit
5294d6b913
Se han modificado 2 ficheros con 14 adiciones y 4 borrados
  1. 2 2
      scripts/parse-git-ref.sh
  2. 12 2
      scripts/shelltest/parse-git-ref.test

+ 2 - 2
scripts/parse-git-ref.sh

@@ -20,7 +20,7 @@ if [[ $1 =~ ^refs/tags/v[5-9]+\.[0-9]+\.[0-9]+$ ]]; then
     PROFILE=emqx
     RELEASE=true
     LATEST=$(is_latest "$1")
-elif [[ $1 =~ ^refs/tags/v[5-9]+\.[0-9]+\.[0-9]+-[0-9]+$ ]]; then
+elif [[ $1 =~ ^refs/tags/v[5-9]+\.[0-9]+\.[0-9]+-patch\.[0-9]+$ ]]; then
     PROFILE=emqx
     RELEASE=true
     LATEST=$(is_latest "$1")
@@ -28,7 +28,7 @@ elif [[ $1 =~ ^refs/tags/e[5-9]+\.[0-9]+\.[0-9]+$ ]]; then
     PROFILE=emqx-enterprise
     RELEASE=true
     LATEST=$(is_latest "$1")
-elif [[ $1 =~ ^refs/tags/e[5-9]+\.[0-9]+\.[0-9]+-[0-9]+$ ]]; then
+elif [[ $1 =~ ^refs/tags/e[5-9]+\.[0-9]+\.[0-9]+-patch\.[0-9]+$ ]]; then
     PROFILE=emqx-enterprise
     RELEASE=true
     LATEST=$(is_latest "$1")

+ 12 - 2
scripts/shelltest/parse-git-ref.test

@@ -8,12 +8,22 @@ Unrecognized tag: refs/tags/v5.2.0-foobar.1
 Unrecognized git ref: v5.2.0
 >>>= 1
 
+./parse-git-ref.sh v5.2.0-1
+>>>2
+Unrecognized git ref: v5.2.0-1
+>>>= 1
+
+./parse-git-ref.sh e5.2.0-1
+>>>2
+Unrecognized git ref: e5.2.0-1
+>>>= 1
+
 ./parse-git-ref.sh refs/tags/v5.1.0
 >>>
 {"profile": "emqx", "release": true, "latest": false}
 >>>= 0
 
-./parse-git-ref.sh refs/tags/v5.1.5-1
+./parse-git-ref.sh refs/tags/v5.1.5-patch.1
 >>>
 {"profile": "emqx", "release": true, "latest": false}
 >>>= 0
@@ -43,7 +53,7 @@ Unrecognized tag: refs/tags/v5.2.0-alpha-1
 {"profile": "emqx-enterprise", "release": true, "latest": false}
 >>>= 0
 
-./parse-git-ref.sh refs/tags/e5.1.5-1
+./parse-git-ref.sh refs/tags/e5.1.5-patch.1
 >>>
 {"profile": "emqx-enterprise", "release": true, "latest": false}
 >>>= 0