Skip to content

Commit cd01543

Browse files
frantumadjankows
authored andcommitted
fix 3.0.0 release workflow for all generators versions
fix typo
1 parent c146772 commit cd01543

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/release-full-3.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,19 @@ jobs:
115115
if: env.RELEASE_OK == 'yes'
116116
working-directory: generators-repo
117117
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
119131
- name: Run maven deploy/release for codegen
120132
if: env.RELEASE_OK == 'yes'
121133
run: |

0 commit comments

Comments
 (0)