@@ -60,20 +60,28 @@ jobs:
6060 fi
6161 echo "SC_VERSION=$MY_POM_VERSION" >> $GITHUB_ENV
6262 - name : Check Release Version codegen-generators
63- id : preRelease generators
63+ id : preReleaseGenerators
6464 if : env.RELEASE_OK == 'yes'
6565 working-directory : generators-repo
6666 run : |
6767 # export GPG_TTY=$(tty)
68- export MY_POM_VERSION_GENERATORS=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
68+ SNAP_API="https://central.sonatype.com/repository/maven-snapshots"
69+ ARTIFACT_PATH="io/swagger/codegen/v3/swagger-codegen"
70+ ROOT_META="${SNAP_API}/${ARTIFACT_PATH}/maven-metadata.xml"
71+ export LAST_SNAP=$(curl -s "$ROOT_META" | grep -oP '(?<=<version>)3\.[^<]+' | sort -V | tail -n1)
72+ echo "LAST_SNAP $LAST_SNAP"
73+ export CODEGEN_VERSION_PROPERTY=-Dswagger-codegen-version=$LAST_SNAP
74+ export MY_POM_VERSION_GENERATORS=`mvn -q -Dexec.executable="echo" ${CODEGEN_VERSION_PROPERTY} -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
75+ echo "generator version: " ${MY_POM_VERSION_GENERATORS}
6976 if [[ $MY_POM_VERSION_GENERATORS =~ ^.*SNAPSHOT$ ]];
7077 then
7178 echo "not releasing snapshot version: " ${MY_POM_VERSION_GENERATORS}
7279 echo "RELEASE_OK=no" >> $GITHUB_ENV
7380 else
7481 echo "RELEASE_OK=yes" >> $GITHUB_ENV
7582 fi
76- echo "SC_VERSION_GENERATORS=$MY_POM_VERSION_GENERATORS" >> $GITHUB_ENV
83+ echo "generator version: " ${$MY_POM_VERSION_GENERATORS}
84+ echo "SC_VERSION_GENERATORS=${MY_POM_VERSION_GENERATORS}" >> $GITHUB_ENV
7785 - name : Run maven install for codegen-generators
7886 if : env.RELEASE_OK == 'yes'
7987 working-directory : generators-repo
0 commit comments