File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,19 @@ jobs:
115
115
if : env.RELEASE_OK == 'yes'
116
116
working-directory : generators-repo
117
117
run : |
118
- mvn --no-transfer-progress -B -Prelease deploy
118
+ GENERATORS_CURRENT_VERSION=$(mvn -q -Dswagger-codegen-version=3.0.69 -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
119
+ if [[ $GENERATORS_CURRENT_VERSION =~ SNAPSHOT$ ]]; then
120
+ echo "Version is a snapshot: $GENERATORS_CURRENT_VERSION"
121
+ else
122
+ GROUP_ID="io.swagger.codegen.v3"
123
+ ARTIFACT_ID="swagger-codegen-generators"
124
+ if mvn -q dependency:get -DgroupId=${GROUP_ID} -DartifactId=${ARTIFACT_ID} -Dversion=${GENERATORS_CURRENT_VERSION} > /dev/null 2>&1; then
125
+ echo "Version ${GENERATORS_CURRENT_VERSION} already exists in Maven Central."
126
+ else
127
+ echo "Version ${GENERATORS_CURRENT_VERSION} does not exist in Maven Central. Deploying"
128
+ mvn --no-transfer-progress -B -Prelease deploy
129
+ fi
130
+ fi
119
131
- name : Run maven deploy/release for codegen
120
132
if : env.RELEASE_OK == 'yes'
121
133
run : |
You can’t perform that action at this time.
0 commit comments